• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

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
0
Arrummzen
Asked:
Arrummzen
  • 3
  • 2
1 Solution
 
mlmccCommented:
What language?

What is PCRE?

mlmcc
0
 
ArrummzenAuthor Commented:
Python.
PCRE = PERL Compatable Regular Expressions

Thank you for your time,
Arrummzen
0
 
ozoCommented:
m/(\w+)\b(?!\s*\()/g
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ArrummzenAuthor Commented:
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
0
 
ozoCommented:
"(?!pattern)"
                 A zero-width negative look-ahead assertion.  For example
                 "/foo(?!bar)/" matches any occurrence of "foo" that isn't
                 followed by "bar".  
0
 
ArrummzenAuthor Commented:
I am very sorry it has taken me so long to close this question.

Thank you for your time,
Arrummzen
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now