in reply to Regex question
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex question
by CountZero (Bishop) on May 22, 2007 at 13:14 UTC |