Arrummzen
asked on
REs. A question (PERL Compatable Regular Expressions)
I need to make a PCRE, that will match any alpha string that is followed is is not followed by a parenthese.
So for
a = b + c * sin ( x )
match
a
b
c
x
but
not
It should also match multi character terms -
answer = variable + function ( Number )
for the above, match-
Answer
variable
Number
but not
function
How would I do this?
Thank you for your time,
Arrummzen
So for
a = b + c * sin ( x )
match
a
b
c
x
but
not
It should also match multi character terms -
answer = variable + function ( Number )
for the above, match-
Answer
variable
Number
but not
function
How would I do this?
Thank you for your time,
Arrummzen
ASKER
Python.
PCRE = PERL Compatable Regular Expressions
Thank you for your time,
Arrummzen
PCRE = PERL Compatable Regular Expressions
Thank you for your time,
Arrummzen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In Python - re.compile ( '(\\w+)\\b(?!\s*\\()' )
What is this ?! all about? Im not sure what you are doing there. It works though.
Thank you for your time,
Arrummzen
What is this ?! all about? Im not sure what you are doing there. It works though.
Thank you for your time,
Arrummzen
"(?!pattern)"
A zero-width negative look-ahead assertion. For example
"/foo(?!bar)/" matches any occurrence of "foo" that isn't
followed by "bar".
A zero-width negative look-ahead assertion. For example
"/foo(?!bar)/" matches any occurrence of "foo" that isn't
followed by "bar".
ASKER
I am very sorry it has taken me so long to close this question.
Thank you for your time,
Arrummzen
Thank you for your time,
Arrummzen
What is PCRE?
mlmcc