Hi list,
a couple of times I have to perform replacements of substrings and I couldn't find a standard solution. By replacing substrings I mean something like replacing 'xy' with 'werty' in 'xyer sd xy' (and not something like '..<1s>..' expandMacrosWith:...). I thought that maybe the replace dialog from paragraph editor may give a hint, but it turns out it is implemented in the controller itself. So I was just wondering, before writing it, if I was missing something in the base image or if anybody already wrote it? Thanks in advance, Andrés |
SequenceableCollection copyReplaceAll:with: {copying}
-----Original Message----- From: Andres Fortier [mailto:[hidden email]] Sent: Friday, August 24, 2007 11:13 AM To: VWNC List Subject: Replace substring with Hi list, a couple of times I have to perform replacements of substrings and I couldn't find a standard solution. By replacing substrings I mean something like replacing 'xy' with 'werty' in 'xyer sd xy' (and not something like '..<1s>..' expandMacrosWith:...). I thought that maybe the replace dialog from paragraph editor may give a hint, but it turns out it is implemented in the controller itself. So I was just wondering, before writing it, if I was missing something in the base image or if anybody already wrote it? Thanks in advance, Andrés |
I guess I *was* missing something. Thanks!
> SequenceableCollection copyReplaceAll:with: {copying} > > -----Original Message----- > From: Andres Fortier [mailto:[hidden email]] > Sent: Friday, August 24, 2007 11:13 AM > To: VWNC List > Subject: Replace substring with > > > Hi list, > a couple of times I have to perform replacements of substrings > and I couldn't find a standard solution. By replacing substrings I mean > something like replacing 'xy' with 'werty' in 'xyer sd xy' (and not > something like '..<1s>..' expandMacrosWith:...). I thought that maybe > the replace dialog from paragraph editor may give a hint, but it turns > out it is implemented in the controller itself. So I was just wondering, > before writing it, if I was missing something in the base image or if > anybody already wrote it? > > Thanks in advance, > Andrés > > |
In reply to this post by Andres Fortier-2
Check out "Regex11" package and look for
CharacterArray>>copyWithRegex: rxString matchesReplacedWith: aString HTH Andre Andres Fortier schrieb: > Hi list, > a couple of times I have to perform replacements of substrings > and I couldn't find a standard solution. By replacing substrings I > mean something like replacing 'xy' with 'werty' in 'xyer sd xy' (and > not something like '..<1s>..' expandMacrosWith:...). I thought that > maybe the replace dialog from paragraph editor may give a hint, but it > turns out it is implemented in the controller itself. So I was just > wondering, before writing it, if I was missing something in the base > image or if anybody already wrote it? > > Thanks in advance, > Andrés > > -- Andre Schnoor Cognitone GmbH www.cognitone.com |
Thanks Andre, I guess regular expressions will do a better job than
copyReplaceAll:with: in this particular case. Andrés Andre Schnoor escribió: > Check out "Regex11" package and look for > > CharacterArray>>copyWithRegex: rxString matchesReplacedWith: aString > > HTH > Andre > > > Andres Fortier schrieb: >> Hi list, >> a couple of times I have to perform replacements of substrings >> and I couldn't find a standard solution. By replacing substrings I >> mean something like replacing 'xy' with 'werty' in 'xyer sd xy' (and >> not something like '..<1s>..' expandMacrosWith:...). I thought that >> maybe the replace dialog from paragraph editor may give a hint, but it >> turns out it is implemented in the controller itself. So I was just >> wondering, before writing it, if I was missing something in the base >> image or if anybody already wrote it? >> >> Thanks in advance, >> Andrés >> >> > |
Free forum by Nabble | Edit this page |