I am cleaning up another person’s regular expressions and they currently end all of theirs with
.*$
So wouldn’t the following be exactly the same?
.*
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
.*will match as much as it can, but by default.doesn’t match newlines. If the text you’re matching against has newlines and you’re in MULTILINE but not DOTALL mode, then.*$might not match where.*does. Without newlines (or if you’re not in MULTILINE) or if you’ve set DOTALL, they’re identical since*is a greedy operator and will match as much as it can.In the end though, the exact answer depends on the regular expression engine. So your results may differ.