473,226 Members | 1,625 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,226 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 1127
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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.