8 points | by Onavo 2 hours ago ago

7 comments

  • jbott 2 hours ago

    Sensationalist title, the actual behavior described in the issue this links to is:

      Rust language doesn't offer lookaround regex features
    
    This is due to the standard library regex implementation not supporting lookaround, not the language itself. Other crates, such as fancy-regex [1] do support this via backtracking.

    1. https://github.com/fancy-regex/fancy-regex

  • teruakohatu 2 hours ago

    > Brave Browser unable to block certain ads due to Rust language limitations

    Deceptive HN title.

    Someone whose GH account has since been deleted posted a comment on an issue a few months ago saying “the rust languages does not support lookaround regex”. Either a language barrier or a misunderstanding, since there is no fundamental issue with rust itself.

    I flagged this submission.

  • throwaway81523 2 hours ago

    This is not a language issue at all, it's that the Rust regex library doesn't support lookaround, and some regexes in the adblocker use that feature. Yeah I had to web search what lookaround is. It means a zero-length conditional match in the expression. It's present in some but not all regex libraries.

  • achille 2 hours ago

    due to library limitation, not language, they could use fancy-regex

  • kibwen 2 hours ago

    The title of this post is currently "Brave Browser unable to block certain ads due to Rust language limitations", which is ludicrous editorialization. Rust doesn't have regex in the language. Rust doesn't even have regex in the stdlib. The most popular crate for regex is https://crates.io/crates/regex , which is an engine whose design deliberately puts a reasonable upper bound on worst-case time complexity by deliberately excluding certain features (originally based on the design discussed in https://swtch.com/~rsc/regexp/regexp1.html ). Guess what, if you want lookaround, there are regex engines in other crates that offer that: https://crates.io/crates/fancy-regex

  • atoav 2 hours ago

    Has nothing to do with the language, clickbait title. This is about a limitation of the regex library they chose to use.

  • losteric 2 hours ago

    What is this submission??

    It's linking a closed issue, with a fairly incendiary title off of one sentence by a now-deleted Github user.

    How did you even find that?