473,785 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question on regular expressions

Hey...no one's answering me in microsoft.publi c.inetserver.as p.general or
microsoft.publi c.scripting.vbs cript, 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?

Nov 18 '05 #1
2 1062
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...excel lent resources.

http://www.gotdotnet.com/Community/U...6-e63d752f2b70

Good Library, http://regexlib.com/

Shan Plourde

ASP.Confused wrote:
Hey...no one's answering me in microsoft.publi c.inetserver.as p.general or
microsoft.publ ic.scripting.vb script, 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?



Nov 18 '05 #2
Hey...thanks!!! !! The workbench works great!

ASP.Confused

"Shan Plourde" <------@---.net> wrote in message
news:iR******** ******@news04.b loor.is.net.cab le.rogers.com.. .
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...excel lent resources.

http://www.gotdotnet.com/Community/U...6-e63d752f2b70
Good Library, http://regexlib.com/

Shan Plourde

ASP.Confused wrote:
Hey...no one's answering me in microsoft.publi c.inetserver.as p.general or
microsoft.publ ic.scripting.vb script, so I'm posting this question here. Ionly 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'swhat I have so far:

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

but it does not work. Got any suggestions?


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4184
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make regular expressions easier to create and use (and in my experience as a regular expression user, it makes them MUCH easier to create and use.) I'm still working on formal documentation, and in any case, such documentation isn't necessarily the...
4
6126
by: Dwayne Epps | last post by:
I've created a function that checks form fields that only will have letters. This is the script: <script type="text/javascript" language="javascript"> function validateString(field, msg, min, max) { if (!min) { min = 1 } if (!max) { max = 65535} if (!field.value || field.value.length < min || field.value.max > max) { alert(msg); field.focus();
5
2693
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one function to verify the name fields, age, email and gender. My question is: if I create a function for each field like the code below, what would be the best way to organize the functions and call them? Would I need one main function and place...
4
374
by: OneSolution | last post by:
I am trying to write a regular expression that will match all the exceptions generated in my application log file. I have done it as such: \bjava\.\w+\.\w+Exception: However, there are two exceptions that I know will occur and I don't care to catch them. So I need to modify the above regular expression to ignore the two exceptions that will get generated. I don't know how to do that. Your help will be much appreciated.
2
5100
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I have to use all the expressions seperately? Here are my regular expressions that check for valid email address and link Dim Expression As String =
8
1828
by: vbmark | last post by:
I'm new to RegEx in vb.net so I'm not sure how to do this. I want to know if a string contains two minus signs "-". If there are two then I want it to return TRUE. I also need to know if the string contains two plus signs "+". Should this be a seperate RegEx or can one RegEx check for both signs? Thanks!
4
5187
by: Együd Csaba | last post by:
Hi All, I'd like to "compress" the following two filter expressions into one - assuming that it makes sense regarding query execution performance. .... where (adate LIKE "2004.01.10 __:30" or adate LIKE "2004.01.10 __:15") .... into something like this: .... where adate LIKE "2004.01.10 __:(30/15)" ...
6
2293
by: Ludwig | last post by:
Hi, i'm using the regular expression \b\w to find the beginning of a word, in my C# application. If the word is 'public', for example, it works. However, if the word is '<public', it does not work: it seems that < is not a valid character, so the beginning of the word starts at theletter 'p' instead of '<'. Because I'm not an expert in regular expressions, maybe someone of you guys can help me? I need the correct regex to find the...
12
363
by: =?Utf-8?B?SlA=?= | last post by:
I am a newbie to regular expressions and want to extract a number from the end of a string. The string would have these formats: image/4567 image/45678 image/456789 I would also want to extract the name if possible from this string too: "image/4567">name</a>
1
4387
by: Allan Ebdrup | last post by:
I have a dynamic list of regular expressions, the expressions don't change very often but they can change. And I have a single string that I want to match the regular expressions against and find the first regular expression that matches the string. I've gor the regular expressions ordered so that the highest priority is first (if two or more regular expressions match the string I want the first one returned) The code that does this has...
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10096
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.