Product Site

5.4.15.1. new (Class Method)

Instantiates a RegularExpression instance. Use the optional parameter pattern to define a regular expression pattern that will be used to match strings. You can select the type of regular expression matching to be “greedy” by specifying option MAXIMAL, or to be “lazy” by specifying option MINIMAL. Option MAXIMAL is the default.

Both pattern and match type can be changed with the parse method.

Important

RegularExpression defines its own init method. Any subclass which also defines its own init method, must forward to its superclass to complete object initialization. For details see Section 4.2.9, “Initialization”.
Example 5.274. RegularExpression class — new method
re1 = .RegularExpression~new
re2 = .RegularExpression~new("Hello?*")