Looking at a question like this, I usually like to seek out prior art that does a good job of not being tainted by either its age or its questionable topicality.
Seems like there's a decent number of practical questions asking for comparisons between two different and explicit things.
All of these questions have hallmarks we generally like:
- They're in-context and not philosophical; someone would benefit from knowing the difference between these.
- There's reason for ambiguity; examples or patterns may see one way, the other way or both ways applied in a code base with little rhyme or reason.
- There are advantages or limitations in choosing one approach over another. Speaking strictly from a Java mind, using
Hashtable
is almost never preferred to using HashMap
unless there were some really draconian concurrency requirements (and there are still probably better ways to do it even then).
In the context of grep, which is a very widely used tool, there are likely some circumstances in which using "normal" grep (e.g. no regex required) is disadvantageous to using grep with the extensions (e.g. grep -E
) or using the Perl variant (grep -P
). There are some systems which still run using Perl that have assumptions about either the way data is shaped or the way data is parsed, and perhaps the Perl extension is the right way to query that.
So that said, I would find value in something comparing the feature sets of these two together.
But I'm not an expert in regex, nor do I even want to play one on TV (doesn't pay well enough). It's up to the community if they would want to support or answer a question like this, but from where I'm sat, I see no real reason not to answer the question.
pcrepattern
would indicate that this is a broad question indeed.