Regex help

I am new to using Regular Expressions. However, I thought this simple one should work {Type=~“Terrain.*”} (in a GKC) but it wouldn’t… so I replaced it with {Type==“Terrain” || Type==“TerrainHighlight”}, which does work.

I was working off the Wikipedia entry for Regular Expressions which informs that “*” is zero or more of the preceding character and “.” is any character.

Can anyone advise me where I am going wrong ?



As far as I can see, you’re using the expression correctly. I tried the same thing in a basic new module and it worked (GKC to send ctrl-d to every item on the map matching my expression). I am using 3.4.2 though.

Maybe learning about regexes is the goal, but if not you could use {Type.startsWith(“Terrain”)} to achieve the same thing.

Thanks for help and the tip. I can try that out as another check next time.