Home > Net >  Regex to match two factors in one?
Regex to match two factors in one?

Time:06-07

Using <div dir=.*?> works fine to match <div dir="auto">.

enter image description here

However, why does <div dir=.*?><br \/> not match <div dir="auto"><br />?

enter image description here

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            
  • Related