MHonArc Resources: VARREGEX

[Prev: USINGLASTPG] | [Resources][TOC] | [Next: WEEKDAYS]

# VARREGEX

- Syntax
- Description
- Default Setting
- Resource Variables
- Examples
- Version
- See Also

## Syntax

Envariable

  `M2H_VARREGEX=`Perl-regex

Element

  `<VARREGEX>`
  Perl-regex
  `</VARREGEX>`

Command-line Option

  `-varregex` Perl-regex

## Description

VARREGEX defines the Perl regular expression matching resource variables. The regex should define a back reference that contains the name of the resource variable and its arguments surround by parentheses.

WARNING | DO NOT MESS WITH THIS RESOURCE UNLESS YOU KNOW WHAT YOU ARE DOING. If not set properly, page output can become munged. One symptom of a bad VARREGEX setting is the occurrence of numerous '`$`' characters in generated pages. Make sure to test your VARREGEX setting before using it with production archives.

## Default Setting

    \$([^\$]*)\$

## Resource Variables

N/A

## Examples

The following does a more stricter match:

    \$([^(\$]+(?:\([^)]+\))?)\$

Although slower than the default, it minimizes potential conflicts in resource files encoded in multi-byte character sets like SJIS.

## Version

2.4.5

## See Also

[Prev: USINGLASTPG] | [Resources][TOC] | [Next: WEEKDAYS]