Prev: MacOSX: Equivalents for TCGETS, TCSETSF, TCSETSW
Next: MacOSX: Equivalents for TCGETS, TCSETSF, TCSETSW (Solution!)
From: Mateusz_madi on 26 May 2010 06:37 Write a regular expression to replace all occurrences of the letter f, followed by any number of characters, followed by the letter a, followed by one or more numeric characters, followed by the letter n, and replace whats found with the string UNIX. Is it possible to do it with tr?? Madi
From: Rainer Weikusat on 26 May 2010 07:45 Mateusz_madi <madi.czadi(a)gmail.com> writes: > Write a regular expression to replace all occurrences of the letter > 'f', followed by any number of characters, followed by the letter 'a', > followed by one or more numeric characters, followed by the letter > 'n', and replace what's found with the string “UNIX”. > > Is it possible to do it with tr?? No.
From: Mateusz_madi on 26 May 2010 08:21 Can anybody help me with that please??
From: Eric Sosman on 26 May 2010 08:45 On 5/26/2010 8:21 AM, Mateusz_madi wrote: > Can anybody help me with that please?? (It would be helpful if you would quote enough context to make your message intelligible on its own.) You were given the answer, which is (as far as I can see) correct. If you can't see why it's correct, I suggest you think about what must happen with inputs like "zfza9nz". -- Eric Sosman esosman(a)ieee-dot-org.invalid
From: John Gordon on 26 May 2010 10:33
In <728b904c-8d4b-4168-bfe2-8d644083c364(a)r9g2000vbk.googlegroups.com> Mateusz_madi <madi.czadi(a)gmail.com> writes: > Write a regular expression to [...] > Is it possible to do it with tr?? No, because tr does not use regular expressions. It sounds like you want sed, not tr. -- John Gordon A is for Amy, who fell down the stairs gordon(a)panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" |