Solved

Regular expression help

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I have been reconstructing a PHP-based application that has grown into a full blown interface system over the last ten years by a developer that has now gone into business for himself building websites. I am not incredibly fond of writing PHP code o…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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…

830 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