anomy-list

Re: catch-all regex?

From: Bjarni R. Einarsson (25921@xyz.molar.is)
Date: Fri 07 Dec 2001 - 14:32:59 UTC

  • Next message: alex morris: "Re: catch-all regex?"

    On 2001-12-06, 10:17:54 (-0800), Harold Paulson wrote:
    > file_list_2 = (.*)
    >
    > will match, "any number of anything". Hmm...actually...that won't
    > match a filename with a newline will it? Maybe:
    >
    > file_list_2 = ([\s\S]*)

    I'd suggest this:

    file_list_2 = (?s).*

    This matches any file name which has zero or more characters. :)

    > the old, "anything that is whitespace, or not whitespace" trick.

    Without the (?s) modifier (same as the s suffix in a s/x/y/s command)
    newlines are exempt from \s - and probably from \S as well.

    -- 
    Bjarni R. Einarsson                           PGP: 02764305, B7A3AB89
     25921@xyz.molar.is                -><-              http://bre.klaki.net/
    

    Check out my open-source email sanitizer: http://mailtools.anomy.net/



    hosted by molar.is