Skip to main content

Timeline for Capturing Groups From a Grep RegEx

Current License: CC BY-SA 3.0

12 events
when toggle format what by license comment
Dec 6, 2022 at 4:40 comment added Corey Another handy option is --om-separator=text (only matching separator) which specifies a separating string. For example, --om-separator=", " separates matches by commas
Feb 11, 2018 at 22:56 comment added Ville pcregrep 8.41 (installed with apt-get install pcregrep on Ubuntu 16.03) doesn't recognize the -Ei switch. It works perfectly without it, though. On macOS, with pcregrep installed via homebrew (also 8.41) as @anishpatel mentions above, at least on High Sierra the -E switch is also not recognized.
Oct 20, 2017 at 22:26 comment added anishpatel On macOS, brew install pcre. Also note that Homebrew's zsh depends on pcre, so you may already have pcre if you installed that.
Mar 17, 2016 at 13:18 comment added zhuguowei yeah, very help, e.g. echo 'r123456 foo 2016-03-17' | pcregrep -o1 'r([0-9]+)' 123456
Jul 31, 2015 at 8:14 comment added Peter Herdenborg @WAF sorry, guess I should have included that info in my comment. I'm on Centos 6.5 and the pcregrep version is apparently very old: 7.8 2008-09-05.
Jul 20, 2015 at 15:08 comment added WAF @PeterHerdenborg What version are you using? I have the same issue and found reference to it here.
Jul 3, 2015 at 14:02 comment added Jason Hu i can't reproduce it. probably the impl of this pcregrep is different. could you provide more info? what about the difference between this and grep -P? not even in man page: linux.die.net/man/1/pcregrep
Mar 25, 2015 at 9:10 comment added Peter Herdenborg My pcregrep doesn't seem to understand the digit after the -o: "Unknown option letter '1' in "-o1". Also no mention of that functionaliy when looking at pcregrep --help
Jan 1, 2014 at 2:06 comment added grebneke pcregrep is not available by default in Mac OS X which is what the OP uses
S Mar 3, 2013 at 17:33 review Late answers
Mar 3, 2013 at 17:33
S Mar 3, 2013 at 17:33 review First posts
Mar 3, 2013 at 17:33
Mar 3, 2013 at 17:14 history answered John Sherwood CC BY-SA 3.0