This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Patterns should not include the separator (unless escaped), even as part of a character class. In conformance with Posix, the Cray `sed' rejects `s/[^/]*$//': use `s,[^/]*$,,'. [...] Portable `sed' regular expressions should use `\' only to escape characters in the string `$()*.0123456789[\^n{}'.
Ah, I didn't read those two conditions as applying simultaneously. Since the second condition essentially says that you must only ever escape a special character to make it non-meaningful or a normal character to make it special, maybe the first condition say something a bit more like ...
Patterns should not include the separator (not even escaped, unless you fancy having to use a semantically significant metacharacter for your separator), even as part of a ...
\* => unportable, a\* may become either a* or a\*
\> => unportable, a\> may become either a> or a\>
\$ => unportable, a\$ may become either a$ or a\$
\, => unportable, part of \{a,b\}
\| => unportable, a\|b may become either a|b or a\|b and the latter
may be parsed as alternation
\/ => in theory unportable in practice it would be insane to introduce
a special sequence \/
\@ \: etc. => in theory unportable, in practice they should be fine.| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |