W3cubDocs

/Dart 2

escape method

String escape (String text)

Returns a regular expression that matches text.

If text contains characters that are meaningful in regular expressions, the resulting regular expression will match those characters literally. If text contains no characters that have special meaning in a regular expression, it is returned unmodified.

The characters that have special meaning in regular expressions are: (, ), [, ], {, }, *, +, ?, ., ^, $, | and \.

Implementation

external static String escape(String text);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-core/RegExp/escape.html