multiline re search recursive

pcregrep --color -M -N CRLF -e "SQLEngine\.\w+\W*\([^\)]*\)" -r --include='\.java$'

-1
By: hute37
2012-01-16 09:19:40

These Might Interest You


  • 1
    perl -i -pe 'BEGIN{undef $/;} s/START.*?STOP/replace_string/smg' file_to_change
    hute37 · 2011-10-05 11:22:36 0
  • This is based on __unixmonkey73469__ answer. You will need to supply `--multiline 1` option to JSON importer if your .json is multiline (i.e. it was prettyfied) And you still need catmandu installed via `cpanm Catmandu`


    1
    catmandu convert JSON --multiline 1 to YAML < file.json > file.yaml
    pavelkaroukin · 2014-09-29 16:45:24 0
  • recursively search dir for a a particular file type, search each file for a particular text. Show Sample Output


    1
    find /name/of/dir/ -name '*.txt' | xargs grep 'text I am searching for'
    erickb · 2011-01-05 15:20:40 0
  • range context (-A -B) search, with exclusion of vcs directories Show Sample Output


    0
    pcregrep -r --exclude_dir='.svn' --include='.*jsp$' -A 2 -B 2 --color "pHtmlHome" .
    hute37 · 2010-12-09 15:26:07 0

What Others Think

What is this "pcregrep" command?
atoponce · 331 weeks and 1 day ago
http://linux.die.net/man/1/pcregrep pcregrep - a grep with Perl-compatible regular expressions. I use it in cygwin
hute37 · 331 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: