Create account / Log in

Bug with Regular Expression match in GKC

Issues with the Vassal engine.

Moderators: uckelman, Tim M

Bug with Regular Expression match in GKC

Postby jrwatts » October 8th, 2020, 12:00 pm

I'm trying to use a Regular Expression match (=~) in the Property Match field of a GKC, but it doesn't seem to be working. A standard equality test (==) works fine, though. Not sure if I'm doing something wrong or if this is a bug.

The Regular Expression I was trying to use is
Code: Select all
DeckName=~"Lakes"
.

Each of the 5 potential boards you can select for the module has a Deck named "Lakes <boardname>" (we need a different deck for each board because the board graphics put it in a different spot on some boards). The pieces in the Lakes decks have a Send to Location that's triggered from this GKC, and it simply doesn't trigger when using the Regular Expression.

If I rename all 5 decks to simply be "Lakes", and change the Property Match expression to
Code: Select all
DeckName=="Lakes"
, it works fine. I can live with this, but it would be nice if the RE match actually worked.

If you need an example I'll try to whip up a simple test module (the Terraforming Mars module is quite big and complicated).

Edit: This is with VASSAL 3.4.5.
jrwatts
 
Posts: 125
Joined: April 29th, 2020, 10:30 pm

Re: Bug with Regular Expression match in GKC

Postby Brent Easton » October 8th, 2020, 12:21 pm

DeckName=~"Lakes"


That is doing exactly what it is supposed to. "Lakes" as a Regular expression will match exactly the text "Lakes" and nothing else. It certainly will not match "Lakes <Deckname>" or Lakes Deck2" or anything else.

I'm no RE expert, but you need something else on the end to match the characters after "Lakes". Something like

DeckName=~"Lakes.*"
User avatar
Brent Easton
 
Posts: 3226
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Bug with Regular Expression match in GKC

Postby jrwatts » October 8th, 2020, 12:43 pm

D'oh! Don't know what I was thinking there. You're quite right. This is what I get for coding late at night. ;)
jrwatts
 
Posts: 125
Joined: April 29th, 2020, 10:30 pm


Return to Technical Support & Bugs

Who is online

Users browsing this forum: No registered users and 3 guests