regexp:first_match

Robert Raschke rtr@REDACTED
Mon Nov 19 13:33:46 CET 2001


Hi,

I don't know much about the regexp module in Erlang, but in general
all (?) regexp packages try and match the longest sequence. Try

regexp:first_match("<DATE>22-03-03</DATE>","<[^<]+>").

instead.

Robby

On Sun, 18 Nov 2001 around 23:40, you wrote:
> Reading the documentation for regexp, I am surprised that
> 
> 2> regexp:first_match("<DATE>22-03-03</DATE>","<.+>").
> {match,1,21}
> 3>
> 
> I should have thought (and wanted!) the result to be
> 
> {match,1,6}
> 
> Anyone know why not?
> 
> Niels Christensen



More information about the erlang-questions mailing list