A neat idea, but I'm against hiding the underlying regular expressions from a user. They're such a powerful tool, anyone using them for matching or extraction should read up on them. That said, for simple use this is cool and probably something that would appeal to beginners.
We hide and abstract things in programming all the time.
For example, the proper (RFC-compliant) regex for an email is very complicated and often implemented the wrong way.
As somebody who has written a lot of regexes, I'd rather uses this library which has the correct abstraction than google the regex for http-urls for the 512th time.
This library doesn't help you here though. It doesn't bring you any abstractions on top of regexes (e.g. parsing URLs/emails). This is merely a different syntax for matching parts of a string.
I hope no one is seriously suggesting that regular expressions should be used in programs, such as email address verification and http parsing. As well as being incredibly slow, they are hard to read, and inferior to application-specific parsers (for example, sometimes non-RFC-compliant emails are actually valid, and dealing with whitespace in html is a nightmare).
For the interactive case, the ability for them to be written quickly is what makes them so helpful, and an abstraction library could take away this advantage.
3. Sometimes a regex is faster than the overhead of a parser, so wouldn't the choice be dependent on context? In other words, regexes are not always slower, true?
4. Wouldn't some abstraction libraries utilize regexes under the hood? Would that be wrong in your view?
P.S. Some languages allow the option for very readable regexes, e.g. separate each component on its own line, with a comment.
Ah, understood. I was thinking "valid == well-formed" without knowing whether it really works (i.e., could be deleted), whereas I see you rightfully point out that it more reasonably means "it works." Thank you, makes sense.
Simply, some sites don't enforce the full set of RFC rules, as such people actually have non-RFC-compliant email addresses that are valid.
How can you 'compile' a regular expression?
For very simple regular expressions, they might be decently fast, but as soon as you start pulling out the more complicated regular expressions needed for parsing, you get slower. Even simple repeats can have a lot of overhead if not used correctly, have a look at "Looking Inside The Regex Engine" at this link http://www.regular-expressions.info/repeat.html. An equivalent parser doesn't need to do any form of backtracking, and doesn't care about the structure. For example, I've seen an application use regular expressions for html parsing. After spending a while figuring out what they actually did, I found the source html had changed its whitespace, but not the DOM structure, which broke the regular expressions.
As for my reasoning above, I think a lot of 'abstraction' libraries would be faster by operating directly on the data, instead of just converting it to regular expressions. The beauty of regular expressions is the speed at which they can be written.
You lose the ability to write them quickly, which considering I mainly use them for code editing or one-off uses, is quite important. The thing about regular expressions is they aren't suited to general programming in their normal form (since they are hard to read, and slow), and the quoted example is better described as a general parser, and could be implemented much better directly then abstracting through regular expressions.
This is a really terrible article. "iOS 6 is a disaster, but it's not just maps.. it's also maps and maps and maps". Seriously? The contents of this article constitutes a "disaster"?
Looks like I've lost all the command line tools. Trying to install them via Xcode 4.4 results in telling me I don't have the appropriate permissions to download them (I have an Apple Developer account but I'm not signed up to any programs).
This of course breaks homebrew installs (I found the issue when trying to run an application that uses image magick).
I think the new UI. One thing I have noticed, though, is that my 'stream' is displaying posts from all sorts of people I have no idea about, not just people in my circles. A little confused with that, the only option I have is to select individual circles.
Great update, I love the line-by-line committing. One thing that would sell me on this app, though, is having an interface for repo issues. Without that, this is more of a "Git for mac" than a "GitHub for mac", in my opinion.
Whilst that might be an interesting idea, it would probably drive people away from focusing on great content. "Ooo I want comments and I'm only two blog posts away!"
My suggestion was only partly serious, but IMO, focusing on great content is probably one reason many blogs are abandoned - people worrying that an entry won't cut it. That doesn't meant everyone should post junk, but sometimes you can write something short and punchy rather than an epic essay.
Agreed. My most successful blogs over the years started initially with pretty low quality, high throughput "just stuff I want to post" stuff. Then eventually they became higher quality (and more difficult to post to). It seems like a good process, rather than just expecting to write high quality stuff out of the gate.