You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Luxembourg edited this page Mar 20, 2013
·
3 revisions
@set Command Object/DO_NUM = regexp
Then, '+setnum cookies=30' would set VA to "Data: cookies = 30".
This eliminates your having to check to see if the player entered
a number, since the regular expression matches only numbers.
Furthermore, the '+' guarantees that there needs to be at least
one character there, so a player can't enter '+setnum cookies='
or '+setnum =10' or similarly malformed input.
Also note that regexps are case-sensitive, but wildcard globbing is not.
Some regular expression functions offer case-insensitive versions, some
regexp can be made case-insensitive by putting (?i) at the start.
Setting the CASE attribute flag is another way of selecting
case-insensitivity.