Re: [PBML] substitution + backreferences + function call
> you can use \U: s/\b($keyword)\b/\U$1/gi;Very cool - I like the option of using e as a regex evaluation option
since I can envision myself needing to evaluate a lot as I do the
substitution. I looked in the Llama book and didn't see this but then
found a reference in Freidl's Mastering Regular Expressions although it
missed a complete list. He called it a Case-Folding Span. Are \1 and \U
the only ones of these?
Randal L. Schwartz wrote:
>>>>>> "da5id" == da5id <da5id@...> writes:
> da5id> but when I try to use:
> da5id> s/\b($keyword)\b/uc $1/gi;
> da5id> I'm getting a literal "uc" rather than the results of the function. Any
> da5id> suggestions - is my approach a sound one?
> Well, for "uc" specifically, you can use \U:
> But in general, you can use /e, as in:
> s/\b($keyword)\b/uc $1/gie;