Scripting: IMRegExp.Replace - parameter for maximum occurences to replace

Started by lenmerkel, August 26, 2014, 02:25:32 AM

Previous topic - Next topic

lenmerkel

The IMRegExp class is a very powerful and straightforward 'helper' for using regular expressions in scripts. The Replace method always replaces All occurences of the matched text. Sometimes though, I only want to replace the First occurence of the matched text.

Can we have an optional integer parameter (MaxReplacements)? If the parameter isn't provided, default to All?
Over the hill, and enjoying the glide.

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lenmerkel

Duh!  :-[

Of course - step away, come back later, look at it from a different direction - works every time . . .

Please mark this as SOLVED.
Over the hill, and enjoying the glide.