in reply to Can't match my regex

"And i don't understand why moving the \s from inside the selection to outside causes the refexp to fail. "

Because you're binding to the end-of-string and \r is matching as a whitespace character after the version number (and is in the value returned to $version)

Why are you binding to the end at all?

/^Version:\s*(\d+)/ seems adequate to me.

-Greg