$regex call causes an error - unknown command - 22/11/17 09:14 AM
I'm not %100 sure that this is an issue or not, however if you do not use the return value of a $regex call an 'Unknown command' error is invoked. The error can be reproduced with the following code snippet.
Code:
alias test { %data = 2d ; validate that the data is correct an usable if ($regex(%data, /^[1-9][smhd]|[1-9][0-9]+[smhd]$/)) { ; this line produces an error ; Error: <nick> 1 Unknown command ; the '1' appears to be the number of groups encountered $regex(%data, /(\D)/g)) ; using the result of the $regex does not invoke an error if ($regex(%data, /(\D)/g)) { echo -a $regml(1) } ; you may consider not testing the result of the $regex as ; bad coding practise however the data has been previously ; tested as being valid } } raw 421:*: { echo 4 -a Error: $1 $2 $3 $4 $5 $6 $7 $8 $9 halt }