Question on regular expressions

A

ASP.Confused

Hey...no one's answering me in microsoft.public.inetserver.asp.general or
microsoft.public.scripting.vbscript, so I'm posting this question here. I
only need help with a regular expression!

----------

Ok. I have the following regular expression:

re.Pattern = "style[^=]*=[^\""]*\""[^\""]*\"""

It will grab any style attribute within HTML that uses double quotes, and
put it in the re.Matches collection.

Now, I want to include single quotes into this regular expression. Here's
what I have so far:

re.Pattern = "style[^=]*=[^\""']*(\""|\')[^\1]*\1"

but it does not work. Got any suggestions?
 
A

ASP.Confused

Hey...thanks!!!!! The workbench works great!

ASP.Confused



Shan Plourde said:
I don't have an immediate solution for you but I recommend that you use
the RegEx toolkits that are out there. They help you to visualize your
regex results...excellent resources.

http://www.gotdotnet.com/Community/...mpleGuid=c5bd7c0c-2945-473a-bb66-e63d752f2b70

Good Library, http://regexlib.com/

Shan Plourde

ASP.Confused said:
Hey...no one's answering me in microsoft.public.inetserver.asp.general or
microsoft.public.scripting.vbscript, so I'm posting this question here. I
only need help with a regular expression!

----------

Ok. I have the following regular expression:

re.Pattern = "style[^=]*=[^\""]*\""[^\""]*\"""

It will grab any style attribute within HTML that uses double quotes, and
put it in the re.Matches collection.

Now, I want to include single quotes into this regular expression. Here's
what I have so far:

re.Pattern = "style[^=]*=[^\""']*(\""|\')[^\1]*\1"

but it does not work. Got any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top