Re: What do you need to have to be considered a Master at Perl?



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

.



Relevant Pages

  • Re: Regular Expression Hangs
    ... You wouldn't need a regular expression to ... a single fixed string. ... Those patterns are defined by rules that are expressed in the ... will capture the following: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Regular Expression Hangs
    ... You wouldn't need a regular expression to match ... a single fixed string. ... Those patterns are defined by rules that are expressed in the ... will capture the following: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: validate email and checks blank as well
    ... going to have more regular expression don't want to use both(require and ... I have all the controls formattted via HTML so they show on the page nice ... I've other controls which i use requirevalidator in the same column, ... textbox to validate and your done. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Regular Expressions and the sub command
    ... I am running this command on a $file, ... : but the output I get takes the regular expression literally, ... capture what you've matched so you can use it in the replacement. ... This is done using parens to capture. ...
    (perl.beginners)
  • Re: regexp problems
    ... my procedure was just to validate an entry widget., ... %substitution "%S". ... your regular expression failed i.e. the expression does not cover ...
    (comp.lang.tcl)