Searching regular expr: How to match the following pattern with quotes, brackets and semicolons?

Discussion in 'Perl Misc' started by Peter Stacy, Nov 8, 2009.

  1. Peter Stacy

    Peter Stacy Guest

    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
    Peter Stacy, Nov 8, 2009
    #1
    1. Advertising

  2. 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
    John W. Krahn, Nov 8, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bartek
    Replies:
    1
    Views:
    7,941
    Unforgiven
    May 26, 2004
  2. Bret
    Replies:
    3
    Views:
    2,506
    Terry Reedy
    Jun 9, 2009
  3. Good Night Moon
    Replies:
    9
    Views:
    279
    Rick DeNatale
    Jul 25, 2007
  4. Marcus Brody

    Brackets () in variable used for pattern match

    Marcus Brody, Sep 3, 2003, in forum: Perl Misc
    Replies:
    6
    Views:
    111
    Tad McClellan
    Sep 5, 2003
  5. Joe Halbrook
    Replies:
    2
    Views:
    125
    Tad McClellan
    Oct 22, 2003
Loading...

Share This Page