regular expression in browser console not returning the expected result [duplicate]

Does anyone has an explanation why this regular expression test returns false in the browser’s console?

enter image description here

In the screenshot above, I create a regex (first line), then test it against a string that should match, but,oddly enough, the test returns false (second line).

What’s strange is that the test returns “true” as long as I don’t press “Enter” (third line).

Regards,

Cyrille