[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Regular expression help

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
PLavelle
Asked:
PLavelle
  • 2
  • 2
1 Solution
 
mvidasCommented:
You should be able to use a pattern of:
"action=""([^\x00]+?\/)"""
The submatch will be what is between the quotes.

Matt
0
 
PLavelleAuthor Commented:
That doesn't seem to work. Here is my test.

action="hi/"

0
 
PLavelleAuthor Commented:
Here was the fix:

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

Just replaced the double quotes with backslashes.

Thanks for you help!!
0
 
mvidasCommented:
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

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now