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

Regular expression - how to differentiate between > and >=

Hi,

I could not find a group dealing with just regular expressions. This
groups seems to answer such questions. Hence I am posting it here.

In my grammar, I need to differentiate between GT and GE.

GE is defined as ">="
GT is defined as ">[^=]"

The problem is, GT now picks up things such as x>0. It matches ">0".
In this case, I need it to match only ">"

Can someone please tell me what is the proper syntax?

Thank you in advance for your help.

Peter

May 2 '07 #1
2 1352
* Peter wrote, On 2-5-2007 21:18:
Hi,

I could not find a group dealing with just regular expressions. This
groups seems to answer such questions. Hence I am posting it here.

In my grammar, I need to differentiate between GT and GE.

GE is defined as ">="
GT is defined as ">[^=]"

The problem is, GT now picks up things such as x>0. It matches ">0".
In this case, I need it to match only ">"

Can someone please tell me what is the proper syntax?

Thank you in advance for your help.

Peter
You can do this with a negative Look Ahead assertion. It looks at the
next character and makes sure it does not match the expression provided:

[>](?!=)

Jesse Houwing
May 2 '07 #2
Jesse,

Thank you very much for your help.

Peter

May 2 '07 #3

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

Similar topics

8
by: nyso | last post by:
Hi, being not very good at php regular expression, could anyone help me giving the regular expression for : - an e-mail address, - a website address (including sub-domain if possible). many...
0
by: Natalia DeBow | last post by:
Hi there, I am stuck here on another problem, trying to come up with a regular expression for the following case: a. if a substring "/*" is detected, there is no "*/" that would follow it; b....
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
9
by: Pete Davis | last post by:
I'm using regular expressions to extract some data and some links from some web pages. I download the page and then I want to get a list of certain links. For building regular expressions, I use...
7
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
2
by: Karthik | last post by:
Hi All, I am trying to match an XML tag using JS regular expressions. The pattern I am using is pattern="/(<" + tagname + ">)" + "(*)" + "(<." + tagname + ">/g)"; where I want to replace...
2
by: Shahid | last post by:
Hi, I am parsing an .HTML file that contains following example code: <div> <p class="html_preformatted" awml:style="HTML Preformatted" dir="ltr" style="text-align:left"><span...
14
by: Andy B | last post by:
I need to create a regular expression that will match a 5 digit number, a space and then anything up to but not including the next closing html tag. Here is an example: <startTag>55555 any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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,...
0
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,...
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.