[GRASS-dev] Re: regex problem for r.in.wms

Hamish hamish_b at yahoo.com
Mon Mar 10 19:34:28 EDT 2008


Hamish wrote:
> In the end I replaced it with "continue until you find an open
> bracket":
>  [^<]*
....
> Otherwise I'd worry about a literal <comment> in a <Name>, and how to
> match until "</Name>" not just "<". But as it is I hope no one would
> be so silly as to use < in a <Name> field.


upon relflection, the greediness of regex would make the original
'[^<]*' match until the last < on the line, not the one next found.
(??????: to stop at the next found you would use '[^<]*?')

still not bullet-proof, but ok I guess.


Hamish



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the grass-dev mailing list