$_ = '-XXX--XXXXXXXXX...XXXXXXWW--WWW.WWWZZZ---ZZZWW..W-.-WWWWWXXX'; printf "%s-%s: %s\n", $-[0]+1, $+[0], $1 while /[.-]*([^.-])(?:\1|[.-])*/g;
1-24: X 25-35: W 36-44: Z 45-57: W 58-60: X
Update: Bug fix. (Wasn't including leading "-" and "." characters.)
In reply to Re: How to deal with such strings?
by ikegami
in thread How to deal with such strings?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |