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 Return n words before and after a search term
Expression
(\s*\S*){2}(ipsum)(\S*\s*){2}
Description
pass in to your search term, a number and an expression to match. Replace the 2 and ipsum with those. Use the "matches" array to return all match strings. Is tolerant of word matches at start and end of string
Matches
(\s*\S*){<2>}(TEXT)(\S*\s*){2} matches "some TEXT to ... word TEXT singled … word TEXT." in "Here is some TEXT to match. Let's see the word TEXT singled out, sans the words between the word TEXT."
Non-Matches
n/a
Author Rating: Not yet rated. Tim vL
   Displaying page 1 of 1 pages; Items 1 to 1

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