//

Apr 28, 2007 21:35

[21:23] Timwi: Can you think of more than three very common cases in which two slashes ('//') might come up in succession? :-) (random quiz ( Read more... )

Leave a comment

Comments 2

pne April 30 2007, 14:08:33 UTC
or indeed $var =~ // which always matches :)))

It does? I thought that the regular expression // was special and stood for "the last successfully matched regular expression". So you could have:

'hello' =~ /[aeiou]/; # true
'goodbye' =~ //; # also true
'HAPPY BIRTHDAY' =~ //; # false: no lower-case vowel in that string

(Not sure what happens if there is no previous successfully matched pattern... *checks perlop* ah, then it acts as an empty string, which will always match.)

Reply

timwi April 30 2007, 18:43:58 UTC
Thanks, I didn't know that :)

Reply


Leave a comment

Up