"SB111" does indeed match the pattern. You want /^SB[0-9]{1,2}\z/i.
Then there's the issue that you use $& when no match occur, even though it's only set on match. I think you use !~ when you meant to use =~.
Then there's the issue that you use $&, which causes all non-capturing regex matches in your program to become slower. $sbNumHost1 would be a suitable replacement for $& here.
In reply to Re: Noob Question - not sure what's wrong
by ikegami
in thread Noob Question - not sure what's wrong
by vishi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |