in reply to Re: On Interviewing and Interview Questions
in thread On Interviewing and Interview Questions
I'd grin and point out that trick questions aren't very nice, then tell you that there is no difference. A wildcard is a regular expression, it just happens to have different syntax from the regular expressions you use in perl or grep. I'd also ask you which version of grep you meant, and enquire as to whether or not it supported PCRE or not.You'd score points for answering back because I enjoy robust debate during an interview. However, I would argue that wildcards and regular expressions are quite different: they have different meta characters (*?[] versus \^$[].|()?*+{}) and with different meanings for those meta characters. Moreover, wildcards are used by the shell to match existing filenames, while regular expressions are not so constrained.
Mentioning different grep (and shell) versions and PCRE is a plus. A bigger plus would be to write down:
and note that this should work with all greps and Unix shells.ls | grep '\.c$'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: On Interviewing and Interview Questions
by demerphq (Chancellor) on Aug 27, 2005 at 09:51 UTC |