webidl2.js
uses JS sticky RegExp in combination with lastIndex.
As there does not seem to be an equivalent for the JS sticky RegExp, we use Dart’s substring
, firstMatch
and check that result.start == 0
to get the same result.
See: Notion > Dart > RegExp for more info.