Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Problem matching text between two words using FLEX

Last post 10-04-2008, 12:08 PM by auriga. 2 replies.
Sort Posts: Previous Next
  •  10-04-2008, 3:02 AM 46870

    Problem matching text between two words using FLEX

    Hello, how can I match the text between the words START and END usig FLEX regular expressions ?

    Example:

    this is line 1
    START text beetwen two commands END
    this is line 3
    START
    this is line 5
    this is line 6
    END
    this line 8

    Thank you.

  •  10-04-2008, 4:24 AM 46872 in reply to 46870

    Re: Problem matching text between two words using FLEX

    I've never used Flex-regex, but this one works in a lot of the regex engines I've worked with:

    (?s)START(?:(?!END).)*END

  •  10-04-2008, 12:08 PM 46880 in reply to 46872

    Re: Problem matching text between two words using FLEX

    Thanks for the answer, I only know LEX style for regex, I understand your logic, how can I translate that to LEX format ? someone knows ?

     

View as RSS news feed in XML