Solved

Regular expression help

Posted on 2007-03-29
4
243 Views
Last Modified: 2010-04-23
I need a regular expression that will find action attributes similar to the following:

action="http://www.test.com/test/"

Basically, I need to find action attributes that have a forward slash before the ending quote.
0
Comment
Question by:PLavelle
  • 2
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 500 total points
ID: 18815547
You should be able to use a pattern of:
"action=""([^\x00]+?\/)"""
The submatch will be what is between the quotes.

Matt
0
 

Author Comment

by:PLavelle
ID: 18815582
That doesn't seem to work. Here is my test.

action="hi/"

0
 

Author Comment

by:PLavelle
ID: 18815686
Here was the fix:

action=\"([^\x00]+?\/)\"

Just replaced the double quotes with backslashes.

Thanks for you help!!
0
 
LVL 35

Expert Comment

by:mvidas
ID: 18815733
Sorry about that, I'm used to vb6 (I see now this is vb.net) and I didn't realize you had to do that in .net. In any case, glad to have helped!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As most anyone who uses or has come across them can attest to, regular expressions (regex) are a complicated bit of magic. Packed so succinctly within their cryptic syntax lies a great deal of power. It's not the "take over the world" kind of power,…
Do you hate spam? I do, and I am willing to bet you do as well. I often wonder, though, "if people hate spam so much, why do they still post their email addresses on the web?" I'm not talking about a plain-text posting here. I am referring to the fa…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now