I'm trying to make a regular expression to match lines like this:
02:Aura,Eura,Eurajoki,Harjavalta,Honkajoki, (...) ,Uusikaupunki,Vehmaa,Ypaja
03:Akaa,Artjarvi,Asikkala,Forssa,Hartola, (...) ,Vesilahti,Virrat,Ylojarvi
Python lets me compile the regular expression so that it ignores case so I don't have to worry about that.
Beginning of the regex would be: '[0-9]:' but the repeating city names get tricky.
It would be easy if they were all just single words, but I just can't come up with something
that would work with ones that have a hyphen or space in them.
Help.
02:Aura,Eura,Eurajoki,Harjavalta,Honkajoki, (...) ,Uusikaupunki,Vehmaa,Ypaja
03:Akaa,Artjarvi,Asikkala,Forssa,Hartola, (...) ,Vesilahti,Virrat,Ylojarvi
Python lets me compile the regular expression so that it ignores case so I don't have to worry about that.
Beginning of the regex would be: '[0-9]:' but the repeating city names get tricky.
It would be easy if they were all just single words, but I just can't come up with something
that would work with ones that have a hyphen or space in them.
Help.
Last edited by Gawwad (2010-08-11 09:29:09)