How do I use substrings in regular expressions?
tvogelaar at de-mare.nl
Wed Apr 14 16:55:24 EDT 2010
I agree with Richard and want to thank you for the script. I don't really demand a regex; I just need to replace the SWF reference with the appropriate JPG.
I used a regex because I often use GREP in BBEdit. But apparently the implementation in runrev is a bit different. It should be based on PCRE, and that supports this behavior. Might this be a little bug? Whatever the case, I am helped!
You noticed the ID was gone in the IMG tag with the JPG. I removed it because I didn't need it. But it's cool with me if it stays in.
> Michael Kann wrote:
>> Here's a somewhat generic script to find any HTML element by its ID
>> and make the replacements you need. It doesn't use regex. I apologize.
> No need to apologize. RegEx is convenient, but it's able to offer that
> convenience usually at the price of performance.
> It almost always takes more lines of code to do the same thing with
> chunk expressions as one can do in RegEx, but is often much faster.
> And when someone else writes the code, as you've done here, you get both
> speed and convenience. :)
> Richard Gaskin
More information about the Use-livecode