RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Non-blank contiguous lines
Expression
(^(?=.*\S).*\n)*
Description
This expression bypasses an infinite-backtracking bug by looking ahead in the current line for any non-whitespace, then matching to the end of the line if the lookahead was positive. Without the lookahead, you'll end up with an infinine backtracking expression and a bad day.
Matches
\tabc\n xyz
Non-Matches
\ \t\n\ \n\n
Author Rating: Not yet rated. Eric Falsken
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials