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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Subject or Title w/ Punctuation
Expression
^([^_][\w\d\@\-]+(?:s\'|\'[a-zA-Z]{1,2})?(?:\,)?(?: [\w\d\@\-]+(?:s\'|\'[a-zA-Z]{1,2})?(?:\,)?)*(?:\.|\!|\?){0,3}[^\s_])$
Description
Here's a regex for a title or subject line. The title (or subject) may contain basic punctuation and may not have leading or trailing spaces or underscores but that's about it.
Matches
Wow, what a day! | 100th Aniversary | This Works...
Non-Matches
!Wow,what a night | _begin_ | This ,wont work' either....
Author Rating: Not yet rated. Ted Cambron
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

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