regex - 05/11/05 04:15 PM
would anyone know how to make a regex, that catches things like:
my bot outputs it as nick[!stuff] even if stuff is null,
i tried making a regex, but it keeps screwing up on the [!stuff]
also, i would like it to allow [!stuff] to be there or not.
heres the regex i tried if it would help:
btw, the %r is in format: a[!b] c[!d] ect
Code:
somthing[!somechars] abc[!xx] ect[!gd]
my bot outputs it as nick[!stuff] even if stuff is null,
i tried making a regex, but it keeps screwing up on the [!stuff]
also, i would like it to allow [!stuff] to be there or not.
heres the regex i tried if it would help:
Code:
$regex(cmd2,%r,/\b((\w+)(?:\[([^\s]*)\])?)\b/m)
btw, the %r is in format: a[!b] c[!d] ect