Fastest way to do case insensitive search and replace?
Hi, is there a way to search case insensitively and replace in Strings in one shot? If MethodFinder methodFor: #(('HaLLol' 'll' 'tt') 'Hattol') doesn't find anything, does that mean "no" right away? Kind regards Markus
On 11 Dec 2014, at 13:42, Markus Fritsche <mfritsche@reauktion.de> wrote:
Hi,
is there a way to search case insensitively and replace in Strings in one shot? If MethodFinder methodFor: #(('HaLLol' 'll' 'tt') 'Hattol') doesn't find anything, does that mean "no" right away?
No, method finder uses a whitelist that is not maintained. Marcus
On 2014-12-11 13:48, Marcus Denker wrote:
If MethodFinder methodFor: #(('HaLLol' 'll' 'tt') 'Hattol') doesn't find anything, does that mean "no" right away?
No, method finder uses a whitelist that is not maintained.
Thanks for claryfying. The answer to my first question: | r | r := 'll' asRegexIgnoringCase. r copy: 'HaLLol' replacingMatchesWith: 'tt'.
Hi Markus, Yes, that's the one. I did send you the answer but my post was rejected by the mailing list. However I see it didn't take you long :-) I find that Regex library pretty marvellous tbh, one of the best bits of Smalltalk I've come across, and it's so damn fast that it's often better than anything specific I can write. Does Vassili Bykov hang around on any of these forums? If I ever meet him, I'm buying him a beer! -- View this message in context: http://forum.world.st/Fastest-way-to-do-case-insensitive-search-and-replace-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (3)
-
jhwoods -
Marcus Denker -
Markus Fritsche