On Sun, Nov 29, 2009 at 6:41 AM, Lennard <l...@xs4all.nl> wrote: > $str =~ /k="([^"]*)" v="([^"]*)"/;
If you don't care about order or number of spaces or anything like that, a simple "if ($line=~/^ <tag k="(.*)" v="(.*)" />$/)" will do. The code I gave was actually for parsing "changeset" and "node" tags, which weren't as uniformly formatted as the "tag" tags, so my attempts at parsing them using regular expressions got way too complicated (it might be possible with backreferences and such, but split worked a lot better). _______________________________________________ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev