Re: What do you need to have to be considered a Master at Perl?
- From: Xho Jingleheimerschmidt <xhoster@xxxxxxxxx>
- Date: Tue, 20 Jan 2009 23:36:45 -0800
Charlton Wilbur wrote:
One of my favorites:
You have a string that comes from a freeform text field where the user
is expected to enter a telephone number. Write a regular expression to
validate it and capture a usable phone number.
Usable by whom? If by some kind of computerized system, then I'd need
to know more about that system it is going into. If the number is to be
regurgitated to a human for the human to use, I'd by inclined to not validate at all, present it to the human as is and let the human do whatever validation/interpretation may be needed.
And, am I allowed to make long distance calls? International? Call the Waltons on Walton's Mountain?
This is usually good for a lot of discussion about what should be valid,
and about the damnfool things that users do. It also shows whether the
candidate has a grasp of basic regular expressions: programmers who are
comfortable with them usually try to figure out what foolish things a
user is likely to do, while programmers who are not comfortable with
them usually try to remember what the syntax is for capturing.
Charlton
Xho
.
- References:
- What do you need to have to be considered a Master at Perl?
- From: sln
- Re: What do you need to have to be considered a Master at Perl?
- From: cartercc
- Re: What do you need to have to be considered a Master at Perl?
- From: Vicky Conlan
- Re: What do you need to have to be considered a Master at Perl?
- From: Tad J McClellan
- Re: What do you need to have to be considered a Master at Perl?
- From: Charlton Wilbur
- What do you need to have to be considered a Master at Perl?
- Prev by Date: Re: What do you need to have to be considered a Master at Perl?
- Next by Date: Re: What do you need to have to be considered a Master at Perl?
- Previous by thread: Re: What do you need to have to be considered a Master at Perl?
- Next by thread: Re: What do you need to have to be considered a Master at Perl?
- Index(es):
Relevant Pages
|