473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Need one Regular Expression - Urgent

hi guys,
i'm looking for one RegEx which can find matches from the bunch of
lines. i want to find all the matches of "<a * href=*>*</a>". if any
one can help me out here, please do come forward.
thanks,
Lucky

Dec 29 '05 #1
6 1130
Lucky,

If you have a reply, pleas, don't than split it up between more messages.
Reply to yourself with the addition.

Cor
Dec 29 '05 #2
You might want to check at www.regexlib.com

"Lucky" <tu************@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
hi guys,
i'm looking for one RegEx which can find matches from the bunch of
lines. i want to find all the matches of "<a * href=*>*</a>". if any
one can help me out here, please do come forward.
thanks,
Lucky
Dec 29 '05 #3

"Lucky" <tu************@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
hi guys,
i'm looking for one RegEx which can find matches from the bunch of
lines. i want to find all the matches of "<a * href=*>*</a>". if any
one can help me out here, please do come forward.


"\<a * href=*\>*\</a\>" in MSWord

"\<a .* href=.*\>.*\</a\>" in Unix IIRC. Be aware this won't find "<a *
Href=*>*</A>"

VB Net may differ.

Dec 30 '05 #4
In the general case this can not be done with regular expressions,
because the <a> element can contain markup itself. You need an HTML
parser for this problem. As far as I can tell Microsoft is of no help
here. If you can consider other languages, there are well-tested
solutions for Perl, Python, and Ruby. For C# I found this link:
http://www.developer.com/net/csharp/article.php/2230091

Dec 30 '05 #5
(?i)<(a{1}?)[^>]*href=[^>]*[>]?(.*?)(?:</\1|/)>{1}?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Homer J Simpson" <no****@nowhere.com> wrote in message
news:qW1tf.14341$6K2.14268@edtnps90...

"Lucky" <tu************@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
hi guys,
i'm looking for one RegEx which can find matches from the bunch of
lines. i want to find all the matches of "<a * href=*>*</a>". if any
one can help me out here, please do come forward.


"\<a * href=*\>*\</a\>" in MSWord

"\<a .* href=.*\>.*\</a\>" in Unix IIRC. Be aware this won't find "<a *
Href=*>*</A>"

VB Net may differ.

Dec 30 '05 #6

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:un*************@TK2MSFTNGP11.phx.gbl...
(?i)<(a{1}?)[^>]*href=[^>]*[>]?(.*?)(?:</\1|/)>{1}?


Not bad, but a{1} is redundant

Dec 31 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: learner | last post by:
Hi, How to find a word is containing only alphabets, numbers, _ and -? Also,It should not start with _ and -? How abt testing with this exp - /^(\w|\d)(\w|\d|-|_)+$/; ?
4
by: Buddy | last post by:
Can someone please show me how to create a regular expression to do the following My text is set to MyColumn{1, 100} Test I want a regular expression that sets the text to the following...
3
by: Joe | last post by:
Hi, I have been using a regular expression that I don’t uite understand to filter the valid email address. My regular expression is as follows: <asp:RegularExpressionValidator...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
6
by: Lucky | last post by:
hi guys, i'm looking for one RegEx which can find matches from the bunch of lines. i want to find all the matches of "<a * href=*>*</a>". if any one can help me out here, please do come forward. ...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
3
by: Lucky | last post by:
hi guys, i'm practising regular expression. i've got one string and i want it to split in groups. i was trying to make one regular expression but i didn't successed. please help me guys. i'm...
14
by: Chris | last post by:
I need a pattern that matches a string that has the same number of '(' as ')': findall( compile('...'), '42^((2x+2)sin(x)) + (log(2)/log(5))' ) = Can anybody help me out? Thanks for any help!
1
by: kang jia | last post by:
hi, now i am doing shopping online page for admin.Admin can upload new items in the web page, but the price of the item should be numeric and it can have decimal place, say the price is 69.99.i don;t...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.