in reply to Re: Regex Question
in thread Regex Question

That is exactly what I wanted. Thanks Not sure I understand why it works though. why does ->  [^\n] - match all the data after the DATE and ZONE to the end of line doesn't it just mean match a beginning of line and a new line?

Replies are listed 'Best First'.
Re: Re: Re: Regex Question
by tos (Deacon) on Jun 03, 2003 at 12:42 UTC
    Hi,

    glad that i could help you.

    The [^\n] is a negated character class. Here it represents all characters which aren't "newlines". The newline-characters remained, though undefined $/, still in your string.

    The regex [^\n]+\n matches on 1-n non-newlines followed by a newline.

    After this there can be 0-n whitespaces \s* followed by another newline. This is your blank-line.

    greetings, tos