in reply to how to split a string and take certain position?

"for the latter question, consider: "
($match) = $sentence =~ /([^:]+)$/
"
I can never really understand how string matching works :P
why do we need a $ at the end to work? i mean, isn't + already = "One or more of the last character"

Replies are listed 'Best First'.
Re^2: how to split a string and take certain position?
by ikegami (Patriarch) on Sep 24, 2007 at 06:13 UTC

    Your confusing two definitions of "last": "previous" and "ending".

    + means "one or more of the previous atom".
    $ (without the m option) means "end of string, or a line feed followed by the end of string".