I would probably use the regular expression:
username=([a-zA-Z0-9\[\]]+) password
Or something similar. Notes regarding this:
- Escaping the brackets ensures you get a literal bracket.
- The
a-zA-Z0-9
spans match alphanumeric characters (as per your example, which was alphanumerc). So this would match any alphanumeric character or brackets.
- The
+
modifier ensures that you match at least one character. The *
(Kleene star) will allow zero repetitions, meaning you would accept an empty string as a valid username.
- I don't know if RegexKitLite allows POSIX classes. If it does, you could use
[:alnum:]
in place of a-zA-Z0-9
. The one I gave above should work if it doesn't, though.
Alternatively, I would disallow brackets in usernames. They're not really needed, IMO.