You can also write your regex as /\A(?>\s*)\D/, where (?>\s*) means grab all whitespaces and don't give them up for backtracking.
I don't know if you consider that more simple or elegant, though.
In reply to Re: Ideas to improve this regexp?
by moritz
in thread Ideas to improve this regexp?
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |