/(.*\.)?(\S+)/
has a needless capture
/(?:.*\.)?(\S+)/
And the .* is useless (OP didn't specify he wanted last possible match)
/\.?(\S+)/
In reply to Re^2: One regex construct to handle multiple string types
by ikegami
in thread One regex construct to handle multiple string types
by neversaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |