When you want the regular expression to apply to multiple lines separated by newline characters, this property should be set to true. When it is false the pattern is applied only to a single line.
In JavaScript version 1.2 in Netscape Navigator, this is the only way to set the pattern to operate on multiple lines.
The 'm' attribute is provided in JavaScript version 1.3 in some implementations.
Note that client-side JavaScript used in Netscape 4 will set the multi-line property to true when it is used in an event handler for a TextArea object. The value is restored to whatever it was before exiting the handler. This suggests that you should explicitly set the multi-line property to the value you require when to parse a regular expression. You cannot rely on the stability of any value you may have stored in that attribute previously.
Since this is a class property (a static property), it belongs to the global built-in RegExp object. This means it is shared by all RegExp object instances and therefore is very transient and will be overwritten as soon as the next regular expression is evaluated. If you want to preserve the value, you will need to copy it immediately before your regular expression has been evaluated and before you call another.
Prev | Home | Next |
RegExp.leftContext | Up | RegExp.prototype |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |