There is WeiDU functionality that exists but is not fully covered in the
readme.
1. BIT... and `BIT...BIT0 0b00000001 (covered under section "15 WeiDU constants")
`BIT0 0b11111110 (not mentioned at all)
For example you can disable the hostile flag of a .spl without writing out all the 1's and 0's
PATCH_IF (BYTE_AT 0x19 BAND BIT2) = BIT2 BEGIN // if hostile flag enabled
WRITE_BYTE 0x19 (THIS BAND `BIT2) // disable hostile flag
END
Note: The (`) symbol is not the same as the apostrophe symbol (')
2. Using ^ inside brackets regexpsYou can exclude certain characters by using "^"s.
Wikipedia does a fine job explaining regular expressions with some examples. Note that regular expressions in WeiDU deviate somewhat, for example the "|" expression corresponds to "\|" in WeiDU.
Some examples in WeiDU:
OUTER_SPRINT test "alan"
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^a]lan" = 0 BEGIN // This will not return true
PRINT "%test%"
END
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^abc]lan" = 0 BEGIN // This will not return true
PRINT "%test%"
END
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^a-z]lan" = 0 BEGIN // This will not return true
PRINT "%test%"
END
OUTER_SPRINT test "blan"
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^a]lan" = 0 BEGIN // This will return true
PRINT "%test%"
END
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^abc]lan" = 0 BEGIN // This will not return true
PRINT "%test%"
END
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^a-z]lan" = 0 BEGIN // This will not return true
PRINT "%test%"
END
OUTER_SPRINT test "2lan"
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^a]lan" = 0 BEGIN // This will return true
PRINT "%test%"
END
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^abc]lan" = 0 BEGIN // This will return true
PRINT "%test%"
END
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^a-z]lan" = 0 BEGIN // This will return true
PRINT "%test%"
END
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^0-9]lan" = 0 BEGIN // This will not return true
PRINT "%test%"
END
OUTER_SPRINT test "22lan"
ACTION_IF "%test%" STRING_MATCHES_REGEXP "[^0-9]lan" = 0 BEGIN // This will not return true
PRINT "%test%"
END