in reply to A silly reg exp question
s{ (\d+) } { '-' x $1 }gex;
Update: I'll add that this allows arbitrary integers in the string, including integers with two or more digits. Assuming that you're sticking to standard sized chess boards, the following is probably sufficient...
s{ ([1-8]) } { '-' x $1 }gex;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A silly reg exp question
by chessgui (Scribe) on Jan 16, 2012 at 15:16 UTC |