Windower Plugin Wild Card & Regex Parser

About

Multiple Windower Plugins use a Wilcard syntax in them such as SpellCast (2.17), AutoExec (2.7) and ChatMon (1.5).

This powerful syntax lets you specify multiple things to match giving you high flexibility.

Multiple Definitions

Each definition in the match string is seperated by a | unless its within a REGEX string.

valueA|valueB|valueC

Anything matching one of these values will return true to the logic check. In SpellCast, Spell=“Fire|Stone|Water” will match if you cast any of those spells, but will not match on Blizzard.

Wildcards

Wildcard is a term meaning “anything”. There are 2 normal wildcard characters, * and ?.

a ? signifies a single character may be 'anything'.

Take the following match for example:

m???e?

monkey will match, because onk match the first 3 ?'s, and y matches the last ?.
master will match, because ast match the first 3 ?'s, and r matches the last ?.
laster will not match, because the l does not match the m of the format string.

A * lets the test know any number of characters can be in between the 2 characters.

Take the following match for example:

m*d*

mandy will match because the an falls in between the m and d's *, the string as at least an m and d in it so it matches.
moody will match becaue the oo falls in between the m and d's *, the string has a and d in it so it matches.
more bloody towels will match because the 'ore bloo' falls in the place of *, and the 'y towels' still fills the last *.
master will not match, because 'aster' fits in the place of the first *, but it can not find a d now, so it returns false.
mad will match, because it finds the m and d, but since the format string has a * at the end, it does not require the string to end in any specific characters.

Using Wildcards in Multiple Definitions

Wildcards may be used in between the pipe key.

The following example will match ALL form of the Fire Spell (I-IV) and Thunder Spell (I-IV) and the Blizzard Spell (I-IV)

Fire*|Thunder*|Blizzard*

Regex... Advanced matching for programmers

REGEX is an EXTREMELY complex and POWERFUL tool used by programmers to do complex matches. Regex support was added to many plugins on January 29th, 2008 using boost::regex.

It's a simple format, and its used IN PLACE OF wildcards, and may be used in multiple definitions.

Regex Format

all Regex matches must open with a (regex<options>) and close with a (/regex). Example (no options):

(regex)^(BLM|SMN|WHM|RDM)/(SCH|WHM|RDM|BLM|SMN)$(/regex)

Regex Options

You may pass options to the opening regex tag to tell the parser what options to test with. By default, It will use Perl style regular expressions and case insensitive match. You may specify the following options to change the regex parser.

-case

(regex-case)....(/regex)

Specifying this switch will make regex test case sensitive.

-basic

(regex-basic) or (regex-basic-case)

Specifying this switch will make it use POSIX Basic format. See: http://www.boost.org/libs/regex/doc/syntax_basic.html

-extended

(regex-extended) or (regex-extended-case)

Specifying this switch will make it use POSIX Extended format. See: http://www.boost.org/libs/regex/doc/syntax_extended.html

-perl

(regex-perl) or (regex-perl-case)

Redundant since default is perl, use if you want it to be clear what format to use.

Specifying this switch will make it use PERL format. See: http://www.boost.org/libs/regex/doc/syntax_perl.html

Using Regex in Multiple Definitions

(regex)^BLM/(WHM|RDM|SCH)$(/regex)|(regex)^RDM/(BLM|WHM|SMN|NIN|WAR)$(/regex)|WHM/*

As you can see, regex may be piped into multiple definitions too, and still can use non regex wild card matches also.

Each match between | are tested if it should use regex or wildcard.

pluginregex.txt · Last modified: 2008/03/15 21:26 by bubbagump
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0