Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: grep only lines having matched pattern

by Discipulus (Canon)
on Apr 01, 2021 at 09:18 UTC ( [id://11130664]=note: print w/replies, xml ) Need Help??


in reply to grep only lines having matched pattern

Hello noviceuser,

is not a grep option what you are looking for, but a match to use inside grep

If you want to match only lines with 03-15-2021 followed by a space (so not a dash) you can use the regex character class dedicated to space-like stuff. See it in perlrequick#Using-character-classes

L*

PS you can practice online using marvellous webperl (already filled with your example, modify the regex with what already suggested) and you can can find other regex practicing tools in my bibliotheca

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-19 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found