> > >> put "1 [A] 2 [B] 3." into tText >> put removeBrackets( tText) >> > > I see that the middle section is omitted with my regex, so I forgot to > make it non-greedy. But I've forgotten how to do that, something about a > question mark, I think?
Sorry about the delay, we had a thunderstorm which broke all Internet network in our area since last Friday. You can do this in 2 ways: - make your .* non greedy by adding a '?' suffix - or modify your regex this way: "\[ [^\]]*]" which means looking for an open bracket followed by zero to any number of chars which are not a close bracket, and last a close bracket. BTW, no need to escape the last closing bracket; the regex engine is smart enough. PCRE library accepts the 2 forms. HTH, Thierry -- ------------------------------------------------ Thierry Douez - sunny-tdz.com sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode