InvalidRegex class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "<!-- InvalidRegex class --> The InvalidRegex exception class describes an exception associated with an invalid regular expression being passed to a method that takes a regular ex...")
 
m (1 revision)
(No difference)

Revision as of 21:26, 16 January 2011

The InvalidRegex exception class describes an exception associated with an invalid regular expression being passed to a method that takes a regular expression argument.

To produce an InvalidRegex exception, you typically use a User Language Throw statement with an InvalidRegex New constructor. This statement must be issued from within a method, and it can only be caught by the code that calls the method. For example, the following statement throws an InvalidRegex exception with the position set to 13, the code set to 666, and the description indicating Bad luck:

throw %(invalidRegex):new(position=13, code=666, - description='Bad luck')

The methods in this class are listed at "List of Regex methods".