Solved

Regular expression help

Posted on 2007-03-29
4
242 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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…

762 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

18 Experts available now in Live!

Get 1:1 Help Now