1) A collection is created on render of the page.
When P22_STRING is changed, I add a member to the collection and refresh the regions.
These regions query the contents of the string, and some manipulate them in some form.
2) The following code is defined in the JS declaration section.
async function paste(input) {
const text = await navigator.clipboard.readText();
$s(input, text);
}
3) On click of a button, this code will take whatever is in the clipboard, and paste it into P22_STRING
paste('P22_STRING');
http://www.grassroots-oracle.com/2019/09/paste-from-clipboard-in-oracle-apex.html