Thanks. Note that $window_size of 0 will probably behave the same as $window_size of 1, though.
Update: Sorry, wrong. I misunderstood your examples. /..{0,-1}/ matches any two characters followed by the literal string "{0,-1}". This could still be a problem for certain input values, but such seem pretty unlikely. So you might want some special code for the boundary case, depending on how varied your inputs might be.
- tye (but my friends call me "Tye")In reply to (tye)Re2: Slicing a string on words
by tye
in thread Slicing a string on words
by dstar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |