M
Doesn't this sound paradoxical ?
I can see a circle in that 0...
The only way to really be sure is to call up the number.
MG> This kind of interview strategy does select some people and
MG> reject others.
That's exactly the point.
MG> Whether the people selected are more suitable to the job than
MG> the people rejected is questionable. It is only obvious to
MG> certain kinds of people. It is not to others.
If you don't have basic Perl knowledge -- and a level of regular
expressions knowledge sufficient to make at least a reasonable attempt
at solving that problem
CW> You'd think that - but in practice, there are a lot of people who
CW> present themselves as Perl experts convincingly enough to get past HR
CW> people and generalist recruiters. [...]
"Do you play golf?"
ha ha ha ha, of course he has *seen* them.No you don't, a simple equality test will suffice for that:
$phone_number eq '3108222400';
The quality of the answers you receive here is in direct
proportion to the quality of the questions you post here...
Have you seen the Posting Guidelines that are posted here frequently?
A phone number rough solution is like it has 4 wheels whenMG> But that's not what you measure, or determine, or show. I
MG> repeat myself: I tend to get rejected in such tests. It doesn't
MG> seem to depend on the area of expertise.
MG> Do you mean that I am worth *nothing*? Yes. I can see you do.
No. I mean that if you can't come up with a rough solution -- not a
perfect solution, not the solution we're looking for, but a rough
solution -- to that problem in five to ten minutes, there's a good
chance you're lacking in the sort of skills that this group uses every
day.
We have a text-input field that we ask the user to type a
telephone number into. As part of data validation,we need to
know if it's a valid phone number and to identify thearea
code. Please write some code to do that.
Quoth lotug <[email protected]>:
Sorry, I guess I assumed to much.
Yes, I was looking for regex that would identify the phone number in a
txt string regardless of how it was formatted. Different people input
phone numbers in different ways. Also, I have regex that identifies a
phone number in a string, but I'm looking for perl regex that will
identify this particular number within a text string.3108222400
(310) 822-2400
1(310) 822-2400
1-310-822-2400
For those forms, something like
/1? [-(]? 310 [-)]? \s* 822 -? 2400/x
may be sufficient, though it will catch strings like '-310)8222400'
that you don't want.
Etc., etc.
You will need to make a complete list of all the forms you want to
catch, and create a regex that matches them. Probably the best way is a
simple alternation, which you can build like
my @cases = (
"3108222400",
"(310) 82202400",
"1(310) 822-2400",
"1-310-822-2400",
);
my ($pattern) = map qr/$_/, join "|", map "\Q$_", @cases;
Ben
UG> it isn't about knowing phone numbers or styles, it is a basic
UG> simple parsing question that any decent perl hacker should be
UG> able to do.
Precisely. It's a toy problem that any competent Perl programmer should
be able to come up with a reasonable solution to within 10 minutes.
What about the many people who have these as they were requiredCW> Precisely. It's a toy problem that any competent Perl programmer should
CW> be able to come up with a reasonable solution to within 10 minutes.
CW> Its principal goal - which it performs admirably - is to eliminate
CW> candidates who are good enough at putting keywords on their resumes and
CW> speaking bafflegab to HR people to get to the interview, but who do not
CW> have any actual hands-on Perl skills.
TZ> The Brainbench Perl tests are also good at filtering out the rabble.
TZ> It's a commercial service so YMMV but for me it's been helpful.
i dislike them in particular and pretty much any multiple choice
automated test. they don't show how someone thinks or codes. code
review and coding assignments of simple problems are much better
indicators. i actually would downgrade anyone who promoted their
brainbench score. it's as useful as msce's! and i know people who will
NOT hire someone dumb enough to get an msce!
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.