Solved

Regular expression help

Posted on 2007-03-29
4
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…

734 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