perl -e '$string="abcX123"; $string =~ /X?(\S+)/; print $1;' [download]
In reply to Capturing everything after an optional character in a regex? by Anonymous Monk