On 10 Sep 2001 10:15:38 -0700, [EMAIL PROTECTED] wrote:
> For position, try:
>
> $p=($job{ra}=~/^(.*)\d\d/?length $1:-1);
>
> $p is 0-based index of '\d\d', or -1 if none.
Wow, I can hardly follow the syntax above. It's very compact.
Could you perhaps break it down so that I can understand what you've
put in it. Particularly the REGEXP of '/^(.*)\d\d/', the next part
"?length" and the "$1:-1".
Actually having looked at one of my Perl books, I can see that /^(.*)/
means "match any character from the beginning of the string".
//? I can't quite find the meaning of. //*? means match 0 or more
times, //+? means match 1 or more times, //?? means match 0 or 1 time.
However, once the regexp is matched, can I compare each of the 2 digit
numbers found with a reference number?
--
regs
rupert
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]