in reply to Regex curly bracket ambiguity
That keeps it from thinking you mean %match, but gives you m/Hello{2}/ (match "Hell", followed by two "o"s). To make the repeat apply to the whole $match, you need to group it: m/(?:${match}){$repeat}/, which makes the added {} unnecessary, leaving you with m/(?:$match){$repeat}/.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex curly bracket ambiguity
by Anonymous Monk on Jun 21, 2007 at 18:08 UTC | |
by Roy Johnson (Monsignor) on Jun 21, 2007 at 18:11 UTC | |
by ysth (Canon) on Jun 21, 2007 at 18:23 UTC |