News for hackers. Stuff that matters.
Re:A Regular Expression Matcher (2007) by dekhn on Thursday February 13, 2020 @03:05PM (#22320963)
There's a common question, "convert an RE into an NFA" (https://en.wikipedia.org/wiki/Thompson%27s_construction)
Re:A Regular Expression Matcher (2007) by abecedarius on Thursday February 13, 2020 @03:15PM (#22321043)
Have you seen that used for interviewing? Yes, some people can do it in a 1-hour interview, but wouldn't you rather ask something that can't be done from memory?
Re:A Regular Expression Matcher (2007) by dekhn on Thursday February 13, 2020 @03:16PM (#22321050)
I know engineers who have asked it, yes. It really seems to be a test for "who was paying attention to that one lecture in CS205 near the end of the semester"
Re:A Regular Expression Matcher (2007) by abecedarius on Thursday February 13, 2020 @03:29PM (#22321145)
Wow. That's quite a tricky test, too -- if you study Thompson's original paper you can see plenty of pitfalls. E.g. his main code would loop forever on a star of a star, and he solves this in an appendix with a preprocessor to rewrite regexes of that kind, only it looked like that rewriting would blow up the size of the regex exponentially in the length of the stack of stars. No hire!
Re:A Regular Expression Matcher (2007) by dekhn on Thursday February 13, 2020 @04:44PM (#22321727)
it doesn't any worse than what Huffman did for his CS classes at UCSC.