phrase method

RegExpRecipe phrase(
  1. String string
)

Implementation

RegExpRecipe phrase(String string) {
  var inner = _augment(
    exactly(string),
    (expr) => expr.replaceAll(r" ", r"\s+"),
  );
  return concat([
    behindIs(either([
      startsWith(nothing),
      _nonWordChar,
    ])),
    inner,
    aheadIs(either([
      _nonWordChar,
      endsWith(nothing),
    ])),
  ]);
}