By using a Regular Expression in MetaScript, you can watch a field or group of fields and trigger the execution of a specific script when a specific field has been edited. For example, suppose you have series of fields whose names contain “30Days” and “60Days” and you only want MetaScript to update a last edited date field when one of the “30Days” fields are edited but should not execute when the “60Days” fields are edited. This task can be accomplished by setting up a loop with a regular expression that looks for “30Days”.
The following MetaScript example looks for "30Days" to be contained in the name of the fields being modified on the form. When it encounters a field that contains "30Days" in it's name, it executes another MetaScript function.
|var field = e.targetName;|