Skip to main content
9 events
when toggle format what by license comment
May 2, 2014 at 1:51 comment added slm @steeldriver - the wikipedia page had this to say about the \K. Since version 7.2, \K can be used in a pattern to reset the start of the current whole match. This provides a flexible alternative approach to look-behind assertions because the discarded part of the match (the part that precedes \K) need not be fixed in length. en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions
May 2, 2014 at 1:49 history edited slm CC BY-SA 3.0
added 185 characters in body
May 2, 2014 at 1:42 history edited slm CC BY-SA 3.0
deleted 4 characters in body
May 2, 2014 at 1:42 comment added slm Source for pcregrep.c is here: ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/…
May 2, 2014 at 1:39 comment added slm @1_CR - it's interesting that it doesn't appear to work with ANYCRLF or ANY either.
May 2, 2014 at 1:35 comment added slm @steeldriver - that works for me as well on 8.32.
May 2, 2014 at 1:28 comment added steeldriver @slm also doesn't appear to explain why pcregrep -Mo '\n\n\K.*$' file does appear to work (at least on my Ubuntu 12.04 box - pcregrep version 8.12)
May 2, 2014 at 1:21 comment added iruvar slm, great observation, this seems to work. But funnily enough, pcregrep can handle \n in look-ahead assertions without the need for -N CRLF! Additionally, the newlines in my file are LF not CRLF which makes the apparent success of this technique all the more puzzling!
May 2, 2014 at 1:14 history answered slm CC BY-SA 3.0