The following regex:
is meant to match on single quotation mark sets, (as in the test block below) with positive lookbehinds for newline, blank, ( and >. (The negative lookaheads are there so that it skips words containing apostrophes of the type I'm they're it's.) In RegexBuddy it works just fine, and I've been careful to copy it back to UE in 'C-style String' format, so that that backslash \ gets the additional '\\'. (Thanks for that Mofi!) (Mostly it works just fine in UE - at least with the Perl regex engine.)
But the above a regex produces a: "You have entered an invalid regular expression". It's not the hex91 / hex92 that seems to be the problem - I've checked - though I'm also looking for a way of avoiding those as well. (If I switch from the Perl to the UE regex engine there's no error message, it says 'script succeeded', but in fact nothing happens.)
The problem persists even if I simplify things, throwing out the dubious hex 91/92's, as well as the 'or' operator '|', as in:
Where have I gone wrong here?
best,
fvg
Code: Select all
UltraEdit.activeDocument.findReplace.replace("((?<=\\R)|(?<=\\s)|(?<=>)|(?<=\\))|(?<=F)|(?<=\\())('|‘)(.*?)('|’)(?!s)(?!r)(?!t)(?!m)","xxx\\3xxx");
Code: Select all
This is text. This is text. This is text. 'This sentence is in quotation marks'. This is text. This is text. This is text. 'This is a sentence containing apostrophy contructions: I'm they're it's won't' This is text. This is text. This is text. This is text. This is text. 'This sentence has a mixture of ordinary apostrophes and hex91, hex92: I’m they’re it's won’t’ This is text. This is text. This is text.
The problem persists even if I simplify things, throwing out the dubious hex 91/92's, as well as the 'or' operator '|', as in:
Code: Select all
UltraEdit.activeDocument.findReplace.replace("((?<=\\R)|(?<=\\s)|(?<=F)|(?<=\\())'(.*?)'(?!s)(?!r)(?!t)(?!m)","xxx\\2xxx");
best,
fvg