Fixes bracket match in rule function

When adding a custom method e.g. "isValid[\[0-9A-Za-z\]+]" using form validation module, I found it got the wrong match "[0-9A-Za-z" as the regular expression, so I prefer using greedy match.
Merge pull request #658 from icefox0801/master

Fixes bracket match in rule function