TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Rosie Pattern Language

44 点作者 rajiv_abraham超过 5 年前

6 条评论

devchix超过 5 年前
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?
wodenokoto超过 5 年前
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 未加载
platz超过 5 年前
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>
paulddraper超过 5 年前
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 未加载
danmg超过 5 年前
Why use a &#x27;better regex&#x27; when PEGs exists?
评论 #21151364 未加载
languagehacker超过 5 年前
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 未加载