RegExp's toLocaleString() and toString()
toLocaleString() and toString() return the literal representation of the regular expression.
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<script type="text/javascript">
var pattern = new RegExp("\\[oo\\]at", "gi");
document.writeln(pattern.toString()); // /\[oo\]at/gi
document.writeln(pattern.toLocaleString()); // /\[oo\]at/gi
</script>
</head>
<body>
</body>
</html>
The valueOf() method for a regular expression returns the regular expression itself.
Home
JavaScript Book
Essential Types
JavaScript Book
Essential Types
REGEXP:
- The Regexp Type
- RegExp constructor
- RegExp Instance Properties
- RegExp's exec() does the matching.
- RegExp's test()
- RegExp's toLocaleString() and toString()
- RegExp Constructor Properties