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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
<a.*?href=(.*?)(?((?:\s.*?)>.*?</a>)(?:(?:\s.*?)>(.*?)</a>)|(?:>(.*?)</a>))
Description
this Expression use conditional expression to eveluate parameter after "HREF" and executes the yes/no part of the expression. this expression finds <A> TAG and returns value of "HREF" and the value hold in between <a></a> tags. the expression returns maximum 3 sub matches. the first match returns the "HREF" tag value and rest of two holds the value of the tag alternativly. so after executing the expression you need to itarate through all the submatches and need to find out non NULL tags to get value. the output of the above matching expamples would be like this : 1: "/url?sa=p&pref=ig&pval=2&q=http://www.google.co.in/ig%3Fhl%3Den" 2:[Personalized Home] 3:[] or NULL the output of the second matching example would be like this. 1:/advanced_search?hl=en 2:[] or NULL 3:[Advanced Search]
Matches
<a href="/url?sa=p&pref=ig&pval=2&q=http://www.google.co.in/ig%3Fhl%3Den" o
Non-Matches
none
Author Rating: The rating for this expression. himraj love
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-2024, RegexAdvice.com | ASP.NET Tutorials