beeconn66 has asked for the wisdom of the Perl Monks concerning the following question:
hello,
let me first say i'm new to perl and pattern matching as well, so this may be a dumb question.
I was wondering if i can pattern match a record which contains variables. Its kind of hard to explain what i mean so let me give an example.
Say i have an employee record of first name, last name, and employee #. in the from
employee(firstname, lastname, soc)
based on that record i want to do pattern matching to see if it meets specific requirements. Requirements that may change in the future. With that being said, is there some way to declare valid patterns for first name, last name, and employeenum.
For example
firstname = [\w]{1,100} lastname = [\w]{1,100} employeenum = [\d]{1,100}
I think what i am asking is there a way to declare a regular expression as a variable?
Does any of this make sense to anyone? Your thoughts/suggestions are appreciated.
20050817 Janitored by Corion: Added formatting
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regular expression help
by graff (Chancellor) on Aug 17, 2005 at 21:21 UTC | |
Re: Regular expression help
by philcrow (Priest) on Aug 17, 2005 at 21:29 UTC | |
Re: Regular expression help
by CountZero (Bishop) on Aug 17, 2005 at 21:14 UTC | |
Re: Regular expression help
by gryphon (Abbot) on Aug 17, 2005 at 21:19 UTC | |
Re: Regular expression help
by QM (Parson) on Aug 17, 2005 at 21:40 UTC | |
Re: Regular expression help
by admiral_grinder (Pilgrim) on Aug 18, 2005 at 18:48 UTC | |
Re: Regular expression help
by beeconn66 (Novice) on Aug 18, 2005 at 12:49 UTC | |
by beeconn66 (Novice) on Aug 18, 2005 at 18:08 UTC | |
by admiral_grinder (Pilgrim) on Aug 18, 2005 at 18:50 UTC |