Solved

REs. A question (PERL Compatable Regular Expressions)

Posted on 2004-03-21
6
205 Views
Last Modified: 2010-04-17
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
Comment
Question by:Arrummzen
  • 3
  • 2
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
What language?

What is PCRE?

mlmcc
0
 
LVL 1

Author Comment

by:Arrummzen
Comment Utility
Python.
PCRE = PERL Compatable Regular Expressions

Thank you for your time,
Arrummzen
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
Comment Utility
m/(\w+)\b(?!\s*\()/g
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:Arrummzen
Comment Utility
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
 
LVL 84

Expert Comment

by:ozo
Comment Utility
"(?!pattern)"
                 A zero-width negative look-ahead assertion.  For example
                 "/foo(?!bar)/" matches any occurrence of "foo" that isn't
                 followed by "bar".  
0
 
LVL 1

Author Comment

by:Arrummzen
Comment Utility
I am very sorry it has taken me so long to close this question.

Thank you for your time,
Arrummzen
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 55
bigHeights  challenge 13 55
How to split this in C++ 4 76
count7 challenge 12 67
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now