Search for string followed by whitespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux