[Pdx-pm] regular expression

John Sechrest sechrest at peak.org
Sat Mar 13 17:19:21 CST 2004


So regular expressions are greedy. So you have to 
provide more constraints.

Instead of 
 % "keyword.*\("
 % but this returns:
 % keyword NeedThis_1(blah, bloh); keyword NeedThis_2(

You could say:
keyword [0-9_A-Za-z]*]\(
And limit it to  characters

You will want to put parens around it, so that you have a handle to 
use it later. 

Or you could say:

keyword [^( ]* \( 
negate the list. And find all the things that are not ( or ' ' 






darthsmily <darthsmily at verizon.net> writes:

 % I need regular expression help.
 % I'm sure I'm overlooking some small detail.
 % 
 % I am working with this string for this example:
 % keyword NeedThis_1(blah, bloh); keyword NeedThis_2(blah, bloh,foo, bar);
 % 
 % 
 % I have tried
 % "keyword.*\("
 % but this returns:
 % keyword NeedThis_1(blah, bloh); keyword NeedThis_2(
 % 
 % What I want to return:
 % NeedThis_1
 % NeedThis_2
 % 
 % Any Ideas?
 % 
 % Thanks.
 % 
 % _______________________________________________
 % Pdx-pm-list mailing list
 % Pdx-pm-list at mail.pm.org
 % http://mail.pm.org/mailman/listinfo/pdx-pm-list

-----
John Sechrest          .         Helping people use
                        .           computers and the Internet
                          .            more effectively
                             .                      
                                 .       Internet: sechrest at peak.org
                                      .   
                                              . http://www.peak.org/~sechrest



More information about the Pdx-pm-list mailing list