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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
target[ ]*[=]([ ]*)(["]|['])*([_])*([A-Za-z0-9])+(["])*
Description
Matches the HTML "target" attribute. I had an editor that edited pages but whe wysiwyg editor would break on link that had a target to say "_top" or another window. So I needed an expression to match the target attribute on links in HTML.
Matches
target = "_top" | target = _top | target = "foo"
Non-Matches
target foo | target "foo" | target = ""
Author Rating: The rating for this expression. Phil Cogbill
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: Updated for single quote matching (was missing end single quote) and empty targets (ex. " ")
Name: Dale
Date: 8/29/2006 11:31:26 PM
Comment:
target[ ]*[=]([ ]*)(["]|['])*([_])*([A-Za-z0-9])*(["]|['])*


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