Using Regular Expressions in Triggers / Evaluations

Folks,

I have been looking at creative ways to test conditions for Triggers and Properties. Part of my project might work well using the Regular Expressions mentioned on the Properties page of the Wiki (i.e. name =~ value).

  1. Is the RegEx functionality working in 3.1.14, or was this note in the Wiki a precursor to what will / might appear in 3.2?
  2. Does this implementation of RegEx follow the POSIX standard, similar to the awk utility? Based on the Java page, it seems to do so, but I wasn’t sure if I missed something.
  3. Has anyone tried using this for Trigger / Conditional testing? Did it work OK, or are there any strange exceptions worth noting?

Thanks, everyone, and for you American gents, happy Independence Day weekend!

  1. Is the RegEx functionality working in 3.1.14, or was this note in the
    Wiki a precursor to what will / might appear in 3.2?

Yes, it has been working in Vassal for some time.

  1. Does this implementation of RegEx follow the POSIX standard, similar
    to the awk utility? Based on the Java page, it seems to do so, but I
    wasn’t sure if I missed something.

It uses the java.util.regex package. Whatever it supplies, we support.

  1. Has anyone tried using this for Trigger / Conditional testing? Did
    it work OK, or are there any strange exceptions worth noting?

I have used it to match simple expressions and had no problems at all.

Regards,
Brent.

swampwallaby,

I’ve been waiting patiently for 3.2 to arrive, as my module could greatly use the “equation math” capabilities discussed for that version. The RegEx possibilities may alleviate a few of the issues for now, especially if I don’t have to re-learn a different implementation of the pattern matching.

Thanks for the info!
Rommel14