Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/caca346341dc293067ac06dd2fa2b760 to your computer and use it in GitHub Desktop.
Save trycf/caca346341dc293067ac06dd2fa2b760 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
local.strText - "<a href="%pageID:12148%/test1">test1</a>
<div class="service-card-wrapper">
<div class="_2 service-icon"></div>
</div>
<div><a href="%pageID:2211%/test2">test2</a></div>
";
local.aryLinks = [];
local.javaInt1 = javaCast("int", 1);
local.pattern = createObject("java", "java.util.regex.Pattern").compile("%pageID:[0-9]+%");
local.matcher = local.pattern.matcher(local.strText);
writeDump(local.matcher);abort;
/*while (local.matcher.find()){
local.aryLinks.append([
local.matcher.group(javaInt1),
local.matcher.start(javaInt1) + 1,
local.matcher.end(javaInt1) - local.matcher.start(javaInt1),
]);
}*/
writeDump(local.aryLinks);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment