Using <div dir=.*?>
works fine to match <div dir="auto">
.
However, why does <div dir=.*?><br \/>
not match <div dir="auto"><br />
?
Code: https://regex101.com/r/5pP38n/1
CodePudding user response:
The regexp starts matching at the first <div dir=
in the input. Then it looks for the next ><br \/>
in the input. .*?
will match everything between them, which is
"auto">Please