What is the difference between .*
and (.*)
in regular expressions?
From what I've seen,
AB.*DE
and
AB(.*)DE
appear to match the same things but I want to know if there are any differences so I use the correct one.
I need to be able to match any number of characters between AB and DE and even match if there isn't anything between them (ABDE).
If .*
and (.*)
mean the same thing, is there a "better" one to use in terms of standards/best practice?