in reply to Re: Parsing issue
in thread Parsing issue

thanks for your answer, it's good enough for me since no spaces are allowed in argument name and no commas in quoted strings. but I have a little question since I never used regexps with lookahead assertions, what is the '$|' symbol in the regexp (just before the assertion)?

Thanks again

Hotshot

Replies are listed 'Best First'.
Re: Re: Re: Parsing issue
by jj808 (Hermit) on Oct 08, 2002 at 15:40 UTC
    The $ symbol means the end of the line, and the | symbol means 'or'.

    So this part of the regexp

    ($|(?=\w+:))
    translates to "match if either the end of line has been reached, OR if the next part (lookahead) matches one or more alphanumeric characters followed by a colon"

    Without checking for the end of line, the last parameter would always be missed out (it would only match a parameter if it was followed by another one).

    JJ