What I need is something like this:
/<[\w\d]+ ([\w\d]+\=[w\d])+\/>/
Something that would match several attribute key/value pairs. Is that possible?
What I need is something like this:
/<[\w\d]+ ([\w\d]+\=[w\d])+\/>/
Something that would match several attribute key/value pairs. Is that possible?
You'll have much more succes using an XML parser, for example, XML::Parser. Parsing XML using regular expressions is very difficult (impossible?) and unless your use case is trivial, a proper XML parser is the reliable solution.
It may be possible for a very limited range of valid XML. If you are trying to parse XML, I strongly recommend that you use a parser, rather than try to use regular expressions. XML::Twig is a good general-purpose parser available from CPAN.
For further reading, see also: XML parsing vs Regular expressions