473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to use "AND" in regular expression

My understanding is that to search for "big" OR "small" in a string,
one uses the following expression:
r = New Regex("big|small", _
RegexOptions.IgnoreCase Or RegexOptions.Compiled)

What is the syntax for searching for "big" AND "small" in a SINGLE
regular expression statement? (I try to avoid using 2 seperate regular
expressions with "if/then" if possible)

TIA.
Nov 20 '05 #1
2 1343
Try
big.*small|small.*big
HTH
Alex

"John Smith" <ne*****@yahoo.com> wrote in message
news:14**************************@posting.google.c om...
My understanding is that to search for "big" OR "small" in a string,
one uses the following expression:
r = New Regex("big|small", _
RegexOptions.IgnoreCase Or RegexOptions.Compiled)

What is the syntax for searching for "big" AND "small" in a SINGLE
regular expression statement? (I try to avoid using 2 seperate regular
expressions with "if/then" if possible)

TIA.

Nov 20 '05 #2
Just search google: "Regex Visual Basic"

I don't really know but one possibility might be:
http://www.experts-exchange.com/Prog..._20654593.html

John Smith wrote:
My understanding is that to search for "big" OR "small" in a string,
one uses the following expression:
r = New Regex("big|small", _
RegexOptions.IgnoreCase Or RegexOptions.Compiled)

What is the syntax for searching for "big" AND "small" in a SINGLE
regular expression statement? (I try to avoid using 2 seperate regular
expressions with "if/then" if possible)

TIA.


Nov 20 '05 #3

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

Similar topics

1
by: John Smith | last post by:
I have an application which allows me to select records by entering a Regular Expression in a field. With the following I can select all records where pool = PHL-DP OR desc ends in NP, but what I...
5
by: Jeff Sandler | last post by:
I have a web page. It uses JavaScript to test the user's input before sending it to the server. It frequently tests using isNaN() with some very interesting results. The statements in question...
12
by: Robert Mark Bram | last post by:
Hi All, I am using the following trim function: function trim (str) { return str.replace(/^\s*/g, '').replace(/\s*$/g, ''); } The problem is that this doesn't trim instances of the...
25
by: Nitin Bhardwaj | last post by:
Well, i'm a relatively new into C( strictly speaking : well i'm a student and have been doing & studying C programming for the last 4 years).....and also a regular reader of "comp.lang.c" I...
3
by: moi | last post by:
Hello, When user write a decimal number in a textbox with the numeric pad, he hits the "." button but in FRANCE, we use the ",". How to change the "." in the textbox with a "," ? Example : user...
2
by: Johnny Ljunggren | last post by:
Hello all Just noticed that a testprogram I've made creates a non-conforming XML file. Here's the code (C#) and output: XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent =...
2
by: marsarden | last post by:
write code like: int main(void) { int a=10; if(a<20) {} } Compiler ok on dev-cpp . don't we have to add a ";" after if
11
by: S N | last post by:
how to print apostrophe character ' and double quote " in asp using vbscript. my code using response.write replaces " character with inverted question mark. please help
6
by: Russ P. | last post by:
I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends with a "+", for...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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...

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.