?
Solved

REs. A question (PERL Compatable Regular Expressions)

Posted on 2004-03-21
6
Medium Priority
?
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 10646473
What language?

What is PCRE?

mlmcc
0
 
LVL 1

Author Comment

by:Arrummzen
ID: 10646474
Python.
PCRE = PERL Compatable Regular Expressions

Thank you for your time,
Arrummzen
0
 
LVL 84

Accepted Solution

by:
ozo earned 2000 total points
ID: 10646494
m/(\w+)\b(?!\s*\()/g
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 1

Author Comment

by:Arrummzen
ID: 10646508
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
ID: 10646652
"(?!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
ID: 10729738
I am very sorry it has taken me so long to close this question.

Thank you for your time,
Arrummzen
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

777 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