By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Q: Unquoting vars and arrays

@x13 - regular expressions ARE crazy, but they're an essential part of the foundations of computer science. They can also be considered an interesting alternative form of programming. I would highly recommend that you get a book on them, dig in, and really learn how and why they work, and how to use them.

Transparency Disclaimer: even though I followed my own advice (now many years ago), I nearly always need a guide or cheat sheet nearby when writing anything more complicated that "find.*this.*in.*that" !! Every tool seems to have its own variation on regex syntax!

(But once you've learned one of the more full-featured ones, they'll all start to seem familiar --- you won't have to re-learn EVERYTHING all over again each time.)
PS: What I wrote doesn't refute @RogerB 's quote:

Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.

Like I said, regexs are crazy. Just because one knows how to use them doesn't mean one should use them! They're like a peculiar kind of screwdriver: they'll sit in your toolbox largely unused, and they shouldn't be used as a hammer, a prybar, or on most types of screws. But when you need them, you really need them!
Last edited:
It's really simple. And answer is in the name: RegExp's are to parse REGULAR text.
If a text have complex/irregular structure, or is not a text at all, like HTML or JSON, you are ought to use specific tools to deal with it.

Similar threads