InvalidRegex class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (tags, edits and links)
Line 1: Line 1:
<!-- InvalidRegex class -->
<!-- InvalidRegex class -->
The InvalidRegex exception class describes an exception associated with an
The <var>InvalidRegex</var> exception class describes an exception associated with an invalid <var class="term">[[Regex_processing|Regular Expression]]</var> being passed to a method that takes a <var>regular expression</var> argument.
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
To produce an <var>InvalidRegex</var> exception yourself, you typically use a <var class="product">User Language</var> <var>[[Throw]]</var> statement with an <var>InvalidRegex</var> <var>[[New_(InvalidRegex_constructor)|New]]</var> 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 <var>InvalidRegex</var> exception with the position set to <code>13</code>, the code set to <code>666</code>, and the description indicating <code>Bad luck</code>:
an InvalidRegex New constructor.
<p class="code"> [[throw]] %(invalidRegex):new(position=13, code=666, -
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 <code>13</code>,
the code set to <code>666</code>, and the description indicating <code>Bad luck</code>:
<p class="code"> throw %(invalidRegex):new(position=13, code=666, -
                           description='Bad luck')
                           description='Bad luck')
</p>
</p>
   
   
The methods in this class are listed at "[[List of Regex methods]]".
The methods in this class are listed at "[[List_of_InvalidRegex_methods|List of InvalidRegex methods]]".
[[Category:System exception classes]]
[[Category:System exception classes]]

Revision as of 06:19, 22 April 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 yourself, 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 InvalidRegex methods".