ericwsf has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to create a regular expression for what think should be pretty simple straight forward syntax but I am not having any luck
I want to support parsing an ini setting defined like: RepeatingGroup = <name> [, Flatten][, in|out]]
I want "Flatten" and "in|out" to be able to be used in either order.
Examples:
RepeatingGroup = Waiver, Flatten, outThis is the expression I am trying to use
"RepeatingGroup\s*=\s*(?<GroupID>\b[^ \t]+\b)\s*(?=\s*,\s*(?<Flatten>\ +bFlatten\b))?(?=\s*,\s*(?<Direction>\b(in|out)\b))?$"
Many examples I find online suggest the use of the ?= lookahead.
What am I doing wrong?
2017-08-05 Athanasius added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex with lookahead
by karlgoethebier (Abbot) on Aug 04, 2017 at 19:12 UTC | |
|
Re: Regex with lookahead
by tybalt89 (Monsignor) on Aug 04, 2017 at 19:31 UTC | |
|
Re: Regex with lookahead
by Marshall (Canon) on Aug 04, 2017 at 22:53 UTC | |
|
Re: Regex with lookahead
by ericwsf (Novice) on Aug 04, 2017 at 20:31 UTC | |
by tybalt89 (Monsignor) on Aug 04, 2017 at 20:56 UTC | |
by stevieb (Canon) on Aug 05, 2017 at 01:29 UTC | |
by Your Mother (Archbishop) on Aug 05, 2017 at 17:50 UTC | |
by stevieb (Canon) on Aug 05, 2017 at 20:20 UTC | |
|
Re: Regex with lookahead
by Anonymous Monk on Aug 04, 2017 at 19:41 UTC | |
|
Re: Regex with lookahead
by Anonymous Monk on Aug 04, 2017 at 19:49 UTC | |
|
Re: Regex with lookahead
by ericwsf (Novice) on Aug 04, 2017 at 20:46 UTC | |
by ericwsf (Novice) on Aug 04, 2017 at 20:50 UTC | |
|
Re: Regex with lookahead
by tybalt89 (Monsignor) on Aug 04, 2017 at 19:35 UTC | |
|
Re: Regex with lookahead
by ericwsf (Novice) on Aug 04, 2017 at 20:34 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |