9 comments

  • JdeBP1 hour ago
    The author is circling around, but not quite reaching, a statement that POSIX Basic Regular Expressions work everywhere, with the caveat that that not everyone has caught up with version 8 of the Single Unix Specification, which has slightly changed BREs.
  • MathMonkeyMan2 hours ago
    I&#x27;ve always been a stickler for being specific about which regex language your thing accepts, and whether it is to match any substring, or a prefix, or a suffix, or the whole thing, or a line, or a substring of a line, or whatever.<p>Here are some of the [more popular][1] ones, and then there are PCRE and Python.<p>It took me a while to learn that some of the older ones you see in e.g. grep are [specified by POSIX][2].<p>[1]: <a href="https:&#x2F;&#x2F;cppreference.com&#x2F;cpp&#x2F;regex#Regular_expression_grammars" rel="nofollow">https:&#x2F;&#x2F;cppreference.com&#x2F;cpp&#x2F;regex#Regular_expression_gramma...</a><p>[2]: <a href="https:&#x2F;&#x2F;pubs.opengroup.org&#x2F;onlinepubs&#x2F;009696899&#x2F;basedefs&#x2F;xbd_chap09.html" rel="nofollow">https:&#x2F;&#x2F;pubs.opengroup.org&#x2F;onlinepubs&#x2F;009696899&#x2F;basedefs&#x2F;xbd...</a>
  • agnishom1 hour ago
    A while ago, we wrote a paper about finding regexes which match the same way in both the greedy semantics and the leftmost maximal semantics.<p><a href="https:&#x2F;&#x2F;par.nsf.gov&#x2F;servlets&#x2F;purl&#x2F;10534654" rel="nofollow">https:&#x2F;&#x2F;par.nsf.gov&#x2F;servlets&#x2F;purl&#x2F;10534654</a>
  • quotemstr1 hour ago
    It drives me nuts when a developer documents something or other as being a &quot;regex&quot; but doesn&#x27;t mention which <i>dialect</i> of regulation expression he&#x27;s talking about. This habit is particularly common in the Rust, JavaScript, and Python communities, which seem to forget that their language&#x27;s regular expression language isn&#x27;t universal.
    • zahlman22 minutes ago
      Why? <i>Of course</i> it means the dialect that is most directly supported by that language (by builtins or the standard library). And why should they have to consider other dialects? They aren&#x27;t reading regexes from user input (or they&#x27;d be a lot more concerned about sanitization, catastrophic backtracking etc.), and their fellow developers all grok the conventions.
  • jonstewart13 minutes ago
    Then there’s not just the issue of whether the engine supports a particular syntactical feature but the issue of matching semantics. Perl&#x2F;PCRE’s semantics are far different from POSIX’s and some implementations different semantics altogether (and quite reasonably).
  • LoganDark1 hour ago
    &gt; the special characters . * ^ $<p>These already do not work in many tools which require those special characters to be escaped to have any meaning. An easy example is GNU grep, sed, etc. which use BRE (&quot;Basic Regular Expressions&quot;) by default. The article mentions GNU coreutils but does not explain that `-E` is required to fix that behavior.
  • ngruhn1 hour ago
    [dead]
  • Resonix2 days ago
    why I built this
    • greazy1 hour ago
      I think you forgot to post a link?