backreferences in PCRE?

Alex Rice alex at
Thu Nov 13 14:40:29 EST 2003

I can't remember- are any of Rev's REGEX functions capable of doing 

Consider this perl script. It will put a "\" before any quote 
character, but only if it's not already preceded by a "\" character.

$txt = "fu\"bar askldj askld\\\"asd lakj sdkljasd\"";
print "before: ", $txt, "\n";
if($txt =~ s/([^\\])"/$1\\"/g) {
     print "result: ", $txt,"\n";

# ./
before: fu"bar askldj askld\"asd lakj sdkljasd"
result: fu\"bar askldj askld\"asd lakj sdkljasd\"

In transcript I thought it should be :

replaceText(pStr, "([^\\])"&quote, "$1\"&quote)

Which works *except* for the $1 is used literally instead of as a 

Alex Rice <alex at> | Mindlube Software | 

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco

More information about the Use-livecode mailing list