Does anyone else who doesn't work with regular expressions on a regular basis feel like a champ whenever they write one successfully?(self.programming) 83 points posted 4 hours ago by benihana86 commentssharesavehidereport
↑ benihana 24 points 3 hours ago* [-]
↓ I'm a web developer and I rarely use regular expressions. But when the need to use one does arise,
and I write one that does what I expect without having to consult anything, I feel like I just
discovered general relativity. Anyone else feel a great sense of triumph over the natural,
unordered chaos of text? permalinkreportreply
Regees are so fucking easy, the only people posting this I TOTALLEE FEEL LIKE A GEENYUS WHEN I GET IT RIGHT bull crap are people who don't know regexes.
>>8 christopher@chrislaptop$ perl ./valid.pl
Unmatched ( in regex; marked by <-- HERE in m/:( <-- HERE / at ./valid.pl line 1.
Name:
Anonymous2009-03-27 19:41
regexes are easy, what is this person talking about?
she must be the type of person who always keeps a desk reference at arm's length when writing code
Name:
Anonymous2009-03-27 19:45
>>4
you realize [a-zA-z0-9] could be [^\W_], right?
>>15
Random guess: it's the email validation one.
Whenever regular expressions are mentioned some unoriginal person always feels the need to either paste it or link to it.
ever since i read Mastering Regular Expressions i have been unable to control myself, i use regexes for everything.
chomp? who needs chomp? i'll use a regex! FUCK YEAH!
>>20
You actually read the whole thing? Jesus christ. I can understand a two page tutorial; hell thats about the cumulative amount of documentation on using regex that I have read. (Obviously excluding things particular to a specific implementation like class names for java, delimiters for .js etc..) I have no fucking clue how or why anybody would need 368 pages to learn regular expressions; except perhaps the author and publisher of that book.
>>22
The idea of optimizing a regular expression is just plain ludacris. The only actual optimization possible is if you have a situation where a possessive quantifier can be used, and the amount of times that happens are slim to none. What's more, you learn about possessive quantifiers from a two page tutorial anyway. In conclusion: sage.
>>24
I was really implicitly asking why you would buy it in the first place as opposed to why you would read it, although admittedly the two go hand in hand with some slightly differing consequences.
>>25
You can get books freely on the internet you know.
Name:
Anonymous2009-03-28 0:55
>>28
Yes, but then there is no real guilt by a reader for not finishing the book because they didn't spend any money on it.
Name:
Anonymous2009-03-28 2:13
>>21
I, too, own this book, and I, too, read it cover to cover. The nice things about books like that is that they also cover obscure cases or rationales that two-page tutorials wouldn't.
It's still not worth the €50 I paid for it, though.