in reply to constants within regular expression?
Constants are transformed into subroutines (at least in some cases, I'm not too familiar with them at all). So one possibility of what to do is get a subroutine call inside your regex. Looking at the perldocs for constant and perlre, I came up with this working code. It uses a highly experimental regex feature, so you probably won't want to use this. Take a look at the perlre documentation to learn more about what the (??{}) construct does. It worked for me, so here it is.
Update: I figure I'd cross this out just because you really don't want to use an experimental feature, do you? As discovered with the help of Zed_Lopez, you should really use something like this regex snippet. Or, follow perrin's advice and just use variables instead of constants :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: constants within regular expression?
by sauoq (Abbot) on Nov 26, 2003 at 06:49 UTC | |
by zengargoyle (Deacon) on Nov 26, 2003 at 07:00 UTC | |
by Anonymous Monk on Nov 26, 2003 at 07:54 UTC | |
|
Re: Re: constants within regular expression?
by ysth (Canon) on Nov 27, 2003 at 21:54 UTC |