I am an ex-programmer, so please forgive what may be a simple question. In one of my old PHP programs, I came across the following syntax: if ( /<a\s+href=/i.test( $value ) ) PHP: I immediately recognised the format as a regular expression, and understood what it meant. However, this format is something I just don't remember (obviously I did, once, because that was my program that no one else has had access to). I only remember using the function preg_match for this type of test. On trying to refresh my memory, I've been perusing the on-line PHP manual for ages, and just can't find where the manual documents this. Would some kind soul please point me to the correct manual page in the PHP manual for this test function?
The funny thing is, I must have seen it once upon a time to have been able to program this (and it works... I've checked). But where did I see it? I hope someone will answer this.
That isn't PHP my good man, that is javascript I simply put the "/<a\s+href=/i.test" into google and second result shows it is javascript. http://svn.openqa.org/fisheye/browse/selenium/trunk/src/main/resources/core/xpath/util.js?r=2044 if (!/^href$/i.test(nodeName)) return nodeValue; I'm assuming you're using echo and $value is the thing you are testing inside JS.
OMG! You are so right! I missed the heredoc that surrounds the code! (I used heredoc instead of echo.) I also see that when I copied the code (by hand, not cut-and-paste), I inserted a $ before the "value". Sorry. Thank you for this. Boy, have I wasted my time searching in the PHP manual!