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
}