Dot . in a regular expression matches any character in the supported character set with this characteristic, by default:
Dot has no special meaning in a character class.
Dot does not match newlines by default, a modifier must be set when running the matching function.
Java Example with the DOTALL flag:
Pattern pattern = Pattern.compile("<top>(.*?)</top>",Pattern.DOTALL);
Dot will match all character with the default greedy matching mode.
If you want to made it lazy, you need to add a ? after the quantifier. See Regular Expression - (Lazy|Reluctant) Quantifier
.at matches any three-character string ending with at, including:
With dot all, a common mistake is to assume that a negated character set like [^#] will also not match newlines.
In order to exclude newlines, they must be added to the set.
Example: Every characters that is not ( # and Linux EOL \n) will be expressed as:
[^#\n]