in reply to Pattern matching when there are exception strings

Are your search strings really always surrounded by whitespace (and is that really in contrast to your exceptions?) If so, you might get away with something as simple as /\sALPHA\s/. Or maybe /(^|\s)ALPHA\s/ if your string could begin a line.

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re^2: Pattern matching when there are exception strings
by Moron (Curate) on Sep 21, 2005 at 13:29 UTC
    No, there are no limitations on the search strings that are relevant to finding a solution, other than that they always match the regexp \w+.

    Thanks,

    The Moron

    Free your mind

      You might consider removing your exceptions with s///g and seeing if you have your search string left over. Not an efficient or clean solution to be sure, but it'll work. If you can't find another hook in your spec, it's a messy problem.

      -sauoq
      "My two cents aren't worth a dime.";
      
        That's not such a bad idea, given that every exception needs to have some effect in some way or another before the search string itself can be applied successfully.

        Thanks,

        the Moron

        Free your mind