Timeline for Replace text between brackets
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 2, 2024 at 8:11 | comment | added | Stéphane Chazelas | (like this) | |
| Nov 2, 2024 at 8:04 | comment | added | Stéphane Chazelas | I personally like using s{...}{...} when nesting them, I find it more legible but that may be just me: perl -pe 's{\[.*?\]}{$& =~ s{\b(BAR|WIBBLE|ME)\b}{FOO}gr}ge'. The x flag and breaking it down on several lines may also help for legibility. | |
| Nov 2, 2024 at 1:12 | comment | added | manatwork | You are right @jubilatious1, thank you. Seems I didn't revisited this question for long time, so also added an improved version. | |
| Nov 2, 2024 at 1:07 | history | edited | manatwork | CC BY-SA 4.0 | added 337 characters in body |
| Nov 1, 2024 at 19:01 | comment | added | jubilatious1 | Using @Thor 's example input, I get the input word SOMMER (inside brackets) converted to SOMFOOR. | |
| Oct 24, 2012 at 16:30 | comment | added | Chris | Thanks! That did it. @choroba and @Guru word boundary would have been great too, but I want to be robust in what text the SOMETHING should be. I'll update the question to make that clearer. | |
| Oct 24, 2012 at 16:28 | vote | accept | Chris | ||
| Oct 24, 2012 at 16:15 | history | answered | manatwork | CC BY-SA 3.0 |