TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Rosie Pattern Language

44 pointsby rajiv_abrahamover 5 years ago

6 comments

devchixover 5 years ago
I say this so often: &quot;I can&#x27;t believe it&#x27;s $year and we&#x27;re still using regex!&quot; So when I see &quot;new pattern matching language&quot; my eyes light up and I run over there -- but there&#x27;s no example, no docs, even where it says &quot;examples&quot;, and &quot;docs&quot;, and it&#x27;s hard to find anything I can use. I&#x27;m sorry, am I a vulgar entitled twit for not finding the spoon right away?<p>Regex is terrible to read. Give me an example, things we frequently match for, IP, credit card number, dates ... I read the example for date parsing, I&#x27;m ... not sure what the equiv is? I suggest the authors put up a Rosetta stone of sort, eg. in regex-speak: [0-1][0-9]-[0-3][0-9]-201[0-9], in Rosie-speak: xyz. What about capture group, that&#x27;s what makes regex powerful, not just matching, that and the look-ahead look-behind.<p>Meta-comment: regex is buried in everything significant that I work with, it&#x27;s buried in grep, the language libraries, Splunk. It&#x27;s going to be hard to dislodge, there&#x27;s a deep moat because the tools and common use cases are ugly but well-understood. Why <i>are</i> regex still being used? Why has nothing better come along? How would I even regex-match extended Unicode?
wodenokotoover 5 years ago
If it is so much better and easier to read than regex, why not show any examples? Even the examples page is void of any examples.
评论 #21156504 未加载
评论 #21154250 未加载
评论 #21156332 未加载
评论 #21158197 未加载
platzover 5 years ago
Seems like a middle ground between regex and a parser combinator library.<p>Also there was a strangeloop talk by it&#x27;s creator <a href="https:&#x2F;&#x2F;youtu.be&#x2F;MkTiYDrb0zg" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;MkTiYDrb0zg</a>
paulddraperover 5 years ago
I&#x27;ve look for a while at this, and have come to this conclusion:<p>At the time I need a multi-line pattern language, I just whip up a FSM-like program in code. And I&#x27;ll continue to do that.
评论 #21157512 未加载
评论 #21156759 未加载
danmgover 5 years ago
Why use a &#x27;better regex&#x27; when PEGs exists?
评论 #21151364 未加载
languagehackerover 5 years ago
It&#x27;s really disingenuous to sell your project as a replacement for regular expressions when it has greater expressive power than them in the Chomsky hierarchy.
评论 #21164671 未加载