in reply to Greedy flip flop operator?
You need this: print if (/^start/ .. /^\[^\+]/); # EDIT: /^\[^\+]/ is wrong!
Infact your version says: print between start and (the first) + included , while mine prints between start and a not + included. ie it will print also the first new line without a leading +
The flip flop operator is already greedy: it is true between two patterns, included. In you case perhaps it's better something else: have a switch that signal if start was found and if so just print out strings starting with a + sign.
PS see also my library links
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Greedy flip flop operator?
by LanX (Saint) on Apr 26, 2018 at 07:25 UTC | |
by Discipulus (Canon) on Apr 26, 2018 at 07:36 UTC | |
by LanX (Saint) on Apr 26, 2018 at 07:51 UTC | |
by chengchl (Acolyte) on Apr 26, 2018 at 07:56 UTC | |
by LanX (Saint) on Apr 26, 2018 at 08:57 UTC | |
|
Re^2: Greedy flip flop operator?
by chengchl (Acolyte) on Apr 26, 2018 at 08:06 UTC |