473,387 Members | 1,515 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,387 software developers and data experts.

Difference Between The 2 Statements

RN1
Consider the following RegularExpression:

====================
q[^u]
====================

One of the RegEx tutorials I have come across says the following
w.r.t. the above RegEx:

====================
The above RegEx does not mean a 'q' not followed by a 'u'; rather it
means a 'q' followed by a character that is not a 'u'.
====================

Now what's the difference between the 2 statements that I have cited
above?

Thanks,

Ron
Jun 27 '08 #1
3 827
Hello RN1,
Consider the following RegularExpression:

====================
q[^u]
====================
One of the RegEx tutorials I have come across says the following
w.r.t. the above RegEx:

====================
The above RegEx does not mean a 'q' not followed by a 'u'; rather it
means a 'q' followed by a character that is not a 'u'.
====================
Now what's the difference between the 2 statements that I have cited
above?

Thanks,

condider this input:

q

this could be read as a q not followed by a u.

condider

qd

this could be read as a q not followed by a u.

in regex this would be written as:

q(?!u)

The other regex however will never match the first option, because q[^u]
alsways needs to match at least 2 characters, a q and a different character
than u.
--
Jesse Houwing
jesse.houwing at sogeti.nl
Jun 27 '08 #2
q followed by anything as long as it is not q == match
q followed by q == no match

Jun 27 '08 #3
Also, q followed by nothing = no match

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Peter Morris" <mrpmorris at gmail dot comwrote in message news:uR**************@TK2MSFTNGP04.phx.gbl...
>q followed by anything as long as it is not q == match
q followed by q == no match

Jun 27 '08 #4

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

Similar topics

3
by: lkrubner | last post by:
Suppose I make a call to MySql and zero rows come back. How do I tell the difference between zero rows and failure?
11
by: ATSkyWalker | last post by:
What's the difference between these 2 statements? If you have a String s="12345" s = "54321" But s = "5432"
2
by: Empire City | last post by:
Can someone tell me what is the difference in placing the using in the namespace{} and before the namespace{} ? namespace MyProj { using System; using System.Web; } using System;
3
by: kai | last post by:
Hi, All What is the the difference between If and #If? I read some VB.NET books, sometimes I see #If, but cannot tell why. Please help. Thanks Kai
3
by: new q. | last post by:
I've tried testing this to see if there is any difference but couldn't find any... is there any difference in doing a For - Next loop with/without a value after the 'Next' at the end? e.g....
6
by: nikhilbhavsar | last post by:
Hi Friends , I want to know the exact difference between collection ID and qualifier. I also want to know in detail : When we perform BIND operation on a stored procedure, what we are actually...
5
by: raghu | last post by:
can anyone please tell me difference between the two statements. #define ME int and typedef int ME Both statements do the same work.. right? Thanks a lot in advance.
2
by: vighnesh | last post by:
Hi Folks Please let me know the difference between the following statements. Dim i as Integer Dim i as New Ineger As I tested both declares a variable 'i' of type integer intialized to...
4
by: arnuld | last post by:
i am unable to understand the difference between a "C++ expression" and a "C++ statement". this is what i get from C++ Primer: expression The smallest unit of computation. An expression...
9
by: Logan Lee | last post by:
Hi. What's the difference between while and do while?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.