in reply to Tracking consecutive characters
The naive way is, of course, !!+. There's also a the {MIN,MAX} syntax that lets you explicitly specify a quantity, where either of the numbers the comma and MAX value is optional, that lets you write !{2,}. Since MAX defaults to "infinite" if left out, that will match when there are at least two exclamation marks. MIN defaults to zero, btw, and If you leave out the comma as in .{2}, that sets both MIN and MAX ie it means "exactly this many".
If you put the entire expression in capturing parentheses, you get to look at the length of the captured string.
So you probably want something like m/(!{2,})/g.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tracking consecutive characters
by hv (Prior) on Sep 27, 2004 at 09:20 UTC | |
by Aristotle (Chancellor) on Sep 27, 2004 at 13:36 UTC | |
|
Re^2: Tracking consecutive characters
by Jasper (Chaplain) on Sep 27, 2004 at 10:53 UTC | |
by Aristotle (Chancellor) on Sep 27, 2004 at 13:34 UTC |