lineBreak method

FluentRegex lineBreak([
  1. Quantity quantity = const Quantity.oneTime()
])

Appends universal (Unix + Windows CRLF + Macintosh) line break expression

Example: var regex = FluentRegex() .lineBreak(); expect(regex.findFirst('hello\rworld'), '\r'); expect(regex.findFirst('hello\nworld'), '\n'); expect(regex.findFirst('hello\r\nworld'), '\r\n'); expect(regex.findFirst('hello\r\rworld'), '\r\r'); expect(regex.hasMatch('hello world'), false);

Implementation

FluentRegex lineBreak([Quantity quantity = const Quantity.oneTime()]) => or([
      FluentRegex(
          SpecialCharacter.carriageReturn + SpecialCharacter.carriageReturn),
      FluentRegex(
          SpecialCharacter.carriageReturn + SpecialCharacter.lineFeed),
      FluentRegex(SpecialCharacter.carriageReturn),
      FluentRegex(SpecialCharacter.lineFeed),
    ], quantity);