Hacker News new | ask | show | jobs
by JepZ 3021 days ago
I like to add the lookahead:

  grep -oP '(?<=...)pattern(?=...)'
The caveat however is that the look{ahead,behind} pattern has to be of fixed length.