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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(\b\w+\b) # Match a word and capture it \s+ \1 # Use backreference \1 to match double-ups
Description
Matches
This is is a match
Non-Matches
This isn't!
Author Rating: Not yet rated. Darren Neimke
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: It works, it's just that...
Name: Darren Neimke
Date: 3/31/2004 5:16:19 PM
Comment:
It's formatted for Whitespace matching in .NET. If you want to use it in .NET you will need to set the IgnorePatternWhitespace flag to true. If you are using it in something other than .NET, simply remove the embedded whitespace and comments: (\b\w+\b)\s+\1 You can easily test this out by following the test link at the top of this pattern. Good Luck! - Darren


Title: Mr.
Name: Bert
Date: 3/31/2004 9:21:32 AM
Comment:
It doesn't seem to work. Could you explain something?


Title: This is a test
Name: Steve
Date: 3/14/2004 7:08:50 AM
Comment:
testing something.


Title: Another Testing Entry
Name: Darren Neimke
Date: 3/14/2004 7:06:45 AM
Comment:
Test comment


Title: Testing
Name: Darren Neimke
Date: 3/14/2004 7:04:46 AM
Comment:
Test comment


Title: Thanks Steve...
Name: Darren Neimke
Date: 3/14/2004 6:38:42 AM
Comment:
...glad you like it :-)


Title: Nice use of comments
Name: Steve
Date: 3/14/2004 6:33:29 AM
Comment:
Nice use of comments!


Title: Straight out of the box!
Name: http://4umi.com
Date: 9/6/2003 7:22:45 PM
Comment:
Great stuff!


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