![]() But (?: … ) looks a lot like (?= … ), so that at some point they are bound to clash in the mind of the regex apprentice. In the regex tutorials and books I have read, these various points of syntax are introduced in stages. One of the things that make regexes hard to read for beginners is that many points of syntax that serve vastly different purposes all start with the same two characters: The heroes who expanded regular expressions (such as Henry Spencer and Larry Wall) followed in these footsteps. ![]() Maybe they were into hieroglyphs, maybe they were into cryptography, or maybe that was just the way you did things when you only had a few kilobytes or RAM. Stephen Kleene and Ken Thompson, who started them, obviously wanted something very compact. I don't know the fine details of the history of regular expressions. I thought I would bring them all together in one place. A question mark inside a parenthesis: So many uses!
0 Comments
Leave a Reply. |