Re: dist-git help wanted: write me a regex!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 21, 2009 at 11:24 AM, Jesse Keating <jkeating@xxxxxxxxxx> wrote:
>
> I'm having some difficulty applying this.  It's going into a perl file
> thusly:
>
> $logmsg =~ s|/((Mon|Tues?|Wed|Thu(rs?)?|Fri|Sat|Sun)\s+(Jan|Feb|Mar|Apr|
> May|June?|July?|Aug|Sep|Oct|Nov|Dec)\s+[0-3]?[0-9]\s+(19|20)[0-9][0-9]\s
> +[^<]+<[^\s@]+@[^\s@>]+>\s+2.[4-6].[0-9.-]+\s*)/|mg
>
> But that gives me Unmatched ( in regex; marked by <-- HERE in m/(( <--
> HERE  or something along those lines.
>
> The added "s|...|mg" is coming from other lines in this script which
> look like:
>
> $logmsg =~ s|^\s*\d\d*-\d\d*-\d\d*\s*[^<\n]*<[^>\n]*>\s*$|* \n|mg;
>
> so I'm sure I'm screwing something up when putting it in the script.

You can't use "|" in the "s|||mg" command since it's used inside the
regex.  IIRC you should be able to use "%": "s%%%mg".

-- 
Jeff Ollie

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux