"(\S+?)" is a broken way to capture an attribute. (Hint: what happens if an attribute contains whitespace chars?) Consider using "([^"]+)" instead. Even better, consider profiling to make sure that using a proper XML-parsing module (whose author has already gone looking for this sort of bug) is enough of a slow-down to merit going to hard regex-based chunking.
Update: Yeah, if you care about empty attributes (debatable; I usually don't), "([^"]*)" is the way to go. Thanks Matts!
--In reply to Re(2): Preferred Methods (again)
by FoxtrotUniform
in thread Preferred Methods (again)
by vek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |