“Strictly” regular expressions describe regular languages. But many features, such as the usage of backreferences in the expression itself or recursion for example, can be used to write regular expressions that accept non-regular languages.
For example, the language described by
(a+)b+1
isn't regular, as you can't force that a
appears the same number of times before and after the b
s. At least not in a regular language. With context-free or even context-sensitive languages, that's a completely different matter.
However, regular expressions that only use elementary things such as the various quantifiers, character classes, etc. usually still describe regular languages.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…