Search for string followed by whitespace
| From: | Tim Streater | Date: | Sun, 18 Sep 2011 19:12:00 +0000 |
| Subject: | Search for string followed by whitespace | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-314929@lists.php.net to get a copy of this message | ||
At the moment, I'm doing this:
$start = stripos ($body, "<a ", $loc);
You'll note the space after the '<a'. But I really need to search in $body for
'<a' followed by any whitespace char, at least one, starting at the $loc'th
character, and returning the location of the string in $start.
I had a look at the PCRE and POSIX regexp functions to no avail. Is there a slick way of doing this
with one function call or should I just search for '<a' and brute-force check that the
next char is ' ' or '\t' or '\n'?
Thanks,
--
Cheers -- Tim