Apie regular expressions

Slashdot | Regular Expression Recipes: "That's insane. My feelings on Regexes were set early in my career. I discovered them, and like many started using them everywhere. Then in a code review, my boss pointed to one particularly complex one and said 'See, there's why you shouldn't try to do such complex things with regular expressions, this one has a bug' 'Where?' says me. 'Let's leave that as an exercise for the student. Come ask me if you can't figure it out in an hour or so.' Well, I certainly wasn't going to admit defeat, even though it took me several hours to find the rather subtle problem. So I went back and demanded to know how he had spotted it so fast. And he said 'I didn't. It was a regex 3 lines long. It had to have a bug.'"

Išvada regular expressions naudojimas turi savo vietą, bet nenaudokit jų visur.


Populiarūs šio tinklaraščio įrašai