Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Searching regular expr: How to match the following pattern with quotes, brackets and semicolons? (http://www.velocityreviews.com/forums/t911741-searching-regular-expr-how-to-match-the-following-pattern-with-quotes-brackets-and-semicolons.html)

Peter Stacy 11-08-2009 08:16 AM

Searching regular expr: How to match the following pattern with quotes, brackets and semicolons?
 
In a file I am searching for (the first) expression which matches the following pattern:

aabbcc('<some chars or digits but no special chars nor CRs>',<zero or one blank>'<one or more digits>');


Mind the quotes ' ! Do I have to escape/mask them ?

How can I setup an according regular expression?

Peter


John W. Krahn 11-08-2009 09:27 AM

Re: Searching regular expr: How to match the following pattern withquotes, brackets and semicolons?
 
Peter Stacy wrote:
> In a file I am searching for (the first) expression which matches the following pattern:
>
> aabbcc('<some chars or digits but no special chars nor CRs>',<zero or one blank>'<one or more digits>');


First define how many "some" is and what are "some chars" and what are
"special chars".

> Mind the quotes ' ! Do I have to escape/mask them ?


No.

> How can I setup an according regular expression?


/aabbcc\('[<chars>0-9]{<some>}', ?'[0-9]+'\);/

Where <chars> and <some> should be replaced with valid values.


John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway


All times are GMT. The time now is 06:32 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.