Timeline for Inserting into middle of a string using sed
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 7, 2015 at 20:05 | comment | added | SH1986 | I found out that this sed 's/subtitle[0-9]\{1,3\}">/&<span style="style0">/' was the best one for me. | |
| Jun 7, 2015 at 20:02 | vote | accept | SH1986 | ||
| Jun 7, 2015 at 19:58 | comment | added | ctrl-alt-delor |
you are correct, you need to use \+.
|
|
| Jun 7, 2015 at 19:38 | comment | added | bkmoney | I think + is ERE which isn't supported by POSIX sed | |
| Jun 7, 2015 at 18:59 | comment | added | ctrl-alt-delor |
Replace \{1,3\} with + to get sed 's/subtitle[0-9]+">/&<span style="style0">/' unless it is important for it to go wrong with numbers of more than 3 digits. + means one or more of the previous thing.
|
|
| Jun 7, 2015 at 18:32 | history | answered | bkmoney | CC BY-SA 3.0 |