Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

basically all i need is a regex that will either accept a $ # % >  ~ with lots of other random stuff before it and one that will accept \[\e[0m\] [0m also with random things before it. each of these two possible matchs may allow \s to be after it.

and due to the restrictions of the rest of the program it must be in one single regex, not two seperate checks.... thus both of those checks need to be in the same expression..... sigh

thanks for the help

Replies are listed 'Best First'.
Re: a really simple regex that for some reason I cannot solve
by Bilbo (Pilgrim) on Jun 19, 2003 at 16:03 UTC

    Could you post some example data to show what you are trying to do? Also, perhaps you could post your current attempt at this.

Re: a really simple regex that for some reason I cannot solve
by antirice (Priest) on Jun 19, 2003 at 16:09 UTC

    Really need a bit of clarification on this, but let's try for a shot in the dark. :)

    *REMOVED PENDING RESPONSE TO BILBO's POST*

    Accepts $,#,%,>, or ~. It will not match them multiple times. As far as \[\e[0m\] [0m ...it'll match that text exactly.

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1

    A reply falls below the community's threshold of quality. You may see it by logging in.