Hi,
I have the following Regular Expression from this post (Regular expression for extracting tag attributes).
(\S+)=["\']?((?:.(?!["\']?\s+(?:\S+)=|[>"\']))+.)["\']?
I've created the following PHP code and it works nicely. I get [id='gridview1' and 'id' and 'gridview1'] from the preg_match_all() function.
$regexp = '/(\S+)=["\']?((?:.(?!["\']?\s+(?:\S+)=|[>"\']))+.)["\']?/';
$text = '<asp:gridview id=\'gridview1\' />';
$matches = null;
preg_match_all($regexp, $text, $matches);
print_r($matches);
How should the regular expression be changed to also return 'asp' and 'gridview'? (or 'Foo' and 'bAR' when i use:
<Foo:bAR />