may method

Pattern may()

Makes this pattern optional (matches 0 or 1 times)

Implementation

Pattern may() {
  return Pattern._(
    nodes.Quantifier(
      target: _node,
      min: 0,
      max: 1,
      greedy: true,
      lazy: false,
      possessive: false,
    ),
    namedGroups: _namedGroups,
  );
}