how do i find the position of a regex pattern?
Posted: Mon May 31, 2010 7:36 am
i want to find the position of a regex pattern within a string. i realise i can check for the existence of the pattern with preg_match but what i really need is the position of the found match within the haystack, more like what strpos does.
In short i need a function with the exact behaviour of strpos but that works with regular expressions. can anyone help, please?
In short i need a function with the exact behaviour of strpos but that works with regular expressions. can anyone help, please?