When you put a backslash in front of them they become part of the matching 
machinery's special characters, like . [ and so on.  Without the backslash 
they're normal characters and matched as-is.  So if you had the sed command 
s/(a)+/z/ and you fed it the string aaa, you would not get back z.  You'd only 
get back z if you fed it the string (a)+.  These old regexps of the ed lineage 
also didn't use the newfangled + notation; you had to list how many you wanted 
to match, or zero or more; a* would match zero or more, aa* would match one or 
more, etc.

André Warnier wrote:
Rusty Wright wrote:
[...]
The \( \) is the grouping thing where what matches in it is then substituted for as the \1 on the right hand side.

Yes, but if you escape them with \ , do they still get seen as (meta) grouping indicators, or as plain "(" and ")" ? (I don't remember what sed wants precisely, but in a perl regex, escaping the () would not work as you intend; it would look for real (), and not group.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to