perl -le '$string="abcX123"; $string =~ /X([^\s]+)/; print $1;' 123
Update 2003-12-04 12:50:48 CET: See saouq's node in this thread for a solution which fills all of Anonymous Monk's requirements, as mentioned in opqdonut's post below.
--
Allolex
In reply to Re: Capturing everything after an optional character in a regex?
by allolex
in thread Capturing everything after an optional character in a regex?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |