RegExp Summary Represents regular expressions. Description System.RegExp represents regular expressions. The System.RegExp class provides utilities for matching text with a regular expression pattern. Regular expression literals are created with forward slashes (/) at the beginning and end of a regular expression pattern. An empty regular expression can be created using an empty capturing group: /(?:)/ By default, JS++ supports the ECMAScript 3 flavor of regular expressions. Differences to JavaScript exec has been fixed to properly support the "g" (global match) flag and will return an empty array instead of null if there are no matches. Warning Regular expressions should generally not be used for parsing HTML, XML, or programming language source code. Use an appropriate parser instead of regular expressions to handle these. Examples Instantiation 123import System; System.RegExp re = new System.RegExp(/.+/); Auto-boxing 123import System; System.RegExp re = /.+/; Methods execMatches the regular expression pattern against some text and returns the next match (or null if no matches remain). execAllMatches the regular expression pattern against some text and returns an array of all matches. flagsReturns the flags for the regular expression. globalReturns whether the regular expression will perform a global match. ignoreCaseReturns whether the regular expression will perform a case-insensitive match. lastIndexSets or retrieves the last index for a global match. multilineReturns whether the regular expression will perform a multi-line match. RegExp (Constructor)Constructs a System.RegExp object with the specified regular expression pattern and flags. sourceReturns the regular expression pattern. testMatches the regular expression pattern against some text and returns a Boolean representing whether the match succeeded. toExternalConstructs a new external RegExp object with the value of the internal RegExp object. toStringReturns a string representation of the regular expression value. valueOfReturns the primitive regular expression value wrapped by the System.RegExp object. Share HTML | BBCode | Direct Link