The commented out regex grabs everything up to a space greedily... that is, it matches everything up to the last literal space before end of string (so it grabs up to " Vinny"), and $1 is populated with anything not a literal space up to a literal space (or end of string). Put a space in "Vinny" to see for yourself.
The first regex simply captures everything greedily all the way up to the very last non-whitespace character before end of string into $1, and puts the rest in $2. The 'rest' in this case is the last letter in the first name.
-stevieb
In reply to Re: need help with explaining the output
by stevieb
in thread need help with explaining the output
by perlynewby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |