Re: how to find spaces with a regex?

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

 



Actually \s in perl is any white space: tab, carriage return, formfeed, newline,
or space.

perl -nle 'print if /\ {2,3}/' filename



Vincent wrote:
On Fri, 20 Feb 2004 18:25:58 -0800
"Bevan C. Bennett" <bevan@xxxxxxxxxxxxxxxx> wrote:


I don't think grep actually uses \s to mean a space... at least 'man grep' doesn't appear to mention it... although many other regexps do.



I think you may be right, perl certainly uses it and there is a grep -P option for perl regex though.

-- Jeff Largent ImageLinks, Inc.




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux