I hate regular expressions

If you have no idea what I am talking about, you are lucky. If you do know about regular expressions, then I know you hate them too. But not as much as me, because I am sure that you have never had to document them before. I am not saying that regular expressions aren't important or useful. The syntax of them just sucks beyond words. And like anything else, bad design makes my job a million times harder.

Ugh! What is with using the same characters to mean different things depending on where they are in the expression? For example, the quanitfier '??' means match zero or one times (the first question mark) and use the reluctant algorithm (the second question mark). Makes perfect sense huh? And then there is the caret (^). '^Lauren' means to match a string that starts with Lauren. But put this in brackets, [^Lauren], and suddenly the caret now means the complement of Lauren. Whatever.

And don't get that use of the caret confused with '\P'. You use that when you want the opposite of a property or block range (as opposed to '\p'). And I still can't figure out when you can use a dash without needing to escape it. And I just got told that I have to deal with back references, which I am still trying to figure out how to use.

Plus this whole ordeal has made me realize how stupid the DITA tagging is, especially when you are trying to reuse tables in HTML . I know using a tags named row and entry looks nicer than just tr and td, but totally not necessary since 99% of the time, you are going to just convert them right back to HTML tags. But that is a whole other rant.

</rant>

Advertisements

2 responses to “I hate regular expressions

  1. I fully and totally agree. I despise regular expressions. I think they’re a throwback to the hideous days of old Unix systems where people were always trying to say in one character what they should have been saying with 10 words instead. Just because it’s easy to write doesn’t mean it’s easy to read! Regular expressions may be really powerful, but they could be 100 times more powerful if somebody rewrote the instruction set in PLAIN ENGLISH. There is a big reason we no longer write programs in assembler : it is not human readable. I have things to do – I don’t have the time to waste memorizing a bizarre and arcane set of instructions just because it makes me look nerdier.

  2. This might be a weird question, however I’m a vegan, and I’m looking for contact lenses that do not have some animal “element”. I gather that many lenses contain perhaps ingredients which are tried out with monkeys, or are manufactured with animal products. Does anyone know of any lenses that are entirely artificial?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s