Mailing List Archive

Support open source code!


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

Re: REGEXP in perl questiion



>>>>> "JC" == Jean-Christian Imbeault <jean_christian@example.com> writes:

    >> perl -ne '/^Subject: Cron <.*?> (\S+)/ && print "$1\n"' < file

    JC> But Viktor, won't this only work if there is actually a space
    JC> after the )?

Jc,
(I assume you are talking about the char that follows the progname)

yes, space or newline. To discard other non-space characters like &,
<, > which separate words in shell you migh want to replace \S+ with
something like [^\s&<>]+, but then it becomes ugly :)

Viktor


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links