Use std::regex as the backing implementation of RegularExpression.
This provides common and expected regex features, from basic features like
\w and \d character classes, to more advanced features such as lookahead.
This change used to be gated on the minimum GCC version, because some versions
of GCC had incomplete support for std::regex, but the GCC required by llvm
for the past couple years should be sufficient, according to docs. At this time
GCC >=7.1 is required.
There's an ongoing discussion on the forums [1] to replace llvm::Optional with std::optional. Until that's resolved we should stick with llvm's variant for consistency.
[1] https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716/10