Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Obviously, there might be occasions to improve.

But, regular expressions seem quite well optimize from my point of view.

Regular expressions are used for exact same task regardless of programming language -- using single expression language regardless of programming environment seems like a huge advantage. It can be embedded in configuration file, as a string in a database, on a web page or deep in backend code, and it will still work the same.

The "Java Verbal Expressions" already have "Java" in the name and so are complete loss when it comes to portability.

Then comes the fact that "Java Verbal Expressions" are many times more code that actual regular expressions. That isn't easier to scan, it is much worse.

Regular expressions are very succinct and you can express a lot in a single line of it. Comparable JVE-s would require many lines and wouldn't be more readable for anybody other than a person that doesn't know regexes at all.



'Using a single language to do everything' could be argued on the software side as well.

It might be possible that s-expressions/style would would really well for regex, but nobody has really gone through the effort to do it.

Where I think regexes don't do so well is with UTF and (Grapheme clusters, true word boundaries) and also it's confusing the difference between match/capture/ignore etc..

I'll bet if you really put your mind to it creatively, you might be able to come up with a novel/new approach that wasn't really tried before ... but even if was 'better' it wouldn't catch on for a while (or never) unless there were some big, institutional backers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: