If the second variable is always just 2 numbers seperated by a "." I'd suggest doing it this way:
if ( "$var2." eq substr("$var1.", 0, 1+length $var2) ) { ... }Not a regex thou...
Update at -2: Yes! It's not a regex. But: Why should one use a regex here where a simple string comparison will do?
Could those downvoters please comment what they think is wrong with my solution except that I don't break a fly on the wheel.
In reply to Re: Regex question
by Skeeve
in thread Regex question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |