Dart API Referencedart:coreimplJSSyntaxRegExp

JSSyntaxRegExp Class

Implements

RegExp

Constructors

Code const JSSyntaxRegExp(String pattern, [bool multiLine = false, bool ignoreCase = false]) #

const JSSyntaxRegExp(String pattern,
                     [bool multiLine = false, bool ignoreCase = false])
  : this.pattern = pattern,
    this.multiLine = multiLine,
    this.ignoreCase = ignoreCase;

Code new JSSyntaxRegExp._globalVersionOf(JSSyntaxRegExp other) #

JSSyntaxRegExp._globalVersionOf(JSSyntaxRegExp other)
    : this.pattern = other.pattern,
      this.multiLine = other.multiLine,
      this.ignoreCase = other.ignoreCase {
  regExpAttachGlobalNative(this);
}

Methods

Code Iterable<Match> allMatches(String str) #

Iterable<Match> allMatches(String str) {
  checkString(str);
  return new _AllMatchesIterable(this, str);
}

Code Match firstMatch(String str) #

Match firstMatch(String str) {
  List<String> m = regExpExec(this, checkString(str));
  if (m === null) return null;
  var matchStart = regExpMatchStart(m);
  // m.lastIndex only works with flag 'g'.
  var matchEnd = matchStart + m[0].length;
  return new MatchImplementation(pattern, str, matchStart, matchEnd, m);
}

Code bool hasMatch(String str) #

bool hasMatch(String str) => regExpTest(this, checkString(str));

Code String stringMatch(String str) #

String stringMatch(String str) {
  var match = firstMatch(str);
  return match === null ? null : match.group(0);
}

Fields

Code final bool ignoreCase #

final bool ignoreCase;

Code final bool multiLine #

final bool multiLine;

Code final String pattern #

final String pattern;