in reply to Regex: What does ?k: mean?
If your goal at looking through the source is to discover what regexp the module will use for a certain type of match, this is the trick I use:
perl -MRegexp::Common=RE_ALL -E 'say $RE{num}{real}' (?:(?i)(?:[-+]?)(?:(?=[.]?[0123456789])(?:[0123456789]*)(?:(?:[.])(?:[ +0123456789]{0,}))?)(?:(?:[E])(?:(?:[-+]?)(?:[0123456789]+))|))
Of course there are many other reasons for reading the source. I've just found this shortcut useful when I want to try to understand the behavior of the patterns that are being used, or when an expression's behavior is almost but not quite what I need.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex: What does ?k: mean?
by stevieb (Canon) on Feb 24, 2017 at 23:57 UTC | |
by davido (Cardinal) on Feb 25, 2017 at 00:29 UTC | |
by stevieb (Canon) on Feb 25, 2017 at 00:40 UTC | |
by davido (Cardinal) on Feb 25, 2017 at 04:29 UTC |