techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.6K
active users

#regex

2 posts2 participants0 posts today

Adding lookbehinds to rust-lang/regex, systemf.epfl.ch/blog/rust-rege.

The feature of lookbehinds is very often absent in linear regex engines. These researchers bring them in the `regex` crate. The benchmarks show a reasonable and usable performance making it ready for real-world applications.

The article gives all pointers to the research article and the patches for `regex` (on github.com).

The prevention of unnecessary lookbehind scanning till the end of the haystack is neat!

The words 'Systems and Formalisms Lab' on three lines next to a red rectangle.
SYSTEMF @ EPFL · Adding lookbehinds to rust-lang/regex – SYSTEMF @ EPFL
More from SYSTEMF lab

I love Vim, but of the handful of things that bothers me about it is that its #regex engine requires you to escape capture groups and character count atoms. There's always \v but it's honestly kind of annoying to have to think about picking the right one lol.

#Vim is great, but mother Perl did that part better 😔

Replied in thread

@pkal no issue with #rx - I like it because its easy to reason what it does. I only don't use it all the time because when contributing to other packages some maintainers don't want additional requires unless really needed. It's interesting that #llm's presented with lisp go straight for the raw #emacs #regex syntax. It might have done a better job if I had asked for an rx form but at that point why bother?

Apropos of last weekends #emacs hacking. How many times would you ask an #llm to generate a #regex for you before you give up and just use a #rx form?

🚀 Oh, joy! Another riveting tale of #regex gymnastics: let's dive deep into the thrilling world of "captureless lookbehinds" in #Rust and pretend anyone else cares. 💤 Apparently, watching paint dry wasn't exciting enough, so now we're all experts in #linear-time regex #algorithms. 🤯
systemf.epfl.ch/blog/rust-rege #captureless #lookbehinds #coding #humor #HackerNews #ngated

The words 'Systems and Formalisms Lab' on three lines next to a red rectangle.
SYSTEMF @ EPFL · Adding lookbehinds to rust-lang/regex – SYSTEMF @ EPFL
More from SYSTEMF lab

TIL: in Python's `re` module, a named group (like `(?P<name>...)` can have `_` in the name, but not `-`, because they need to be valid Python identifiers instead of just strings.

I've only been using regular expressions in Python since 1.x. 🤦

PSA:
Tired of your timeline getting full of people debating the merits of
#AI & #LLMs?

Add the following
#regex to your word mutes:
/\s.*LLM*./i

Now my timeline isn't full of the continuing debate as to whether an
#LLM is good or not.

(Hint: You can do the same thing for "AI" too!)

Loving the power of occur in #Emacs, specifically multi-occur-in-matching-buffers in my case, for finding and listing in a single buffer all #regex matches from regex-filtered buffers. Searching across .csv terminology files this way gives me a buffer of search results, each line of which takes me to the line of the source file where the occurrence appears. Extremely useful in #translation work for searching across terminology dictionaries I've created in the past. Discovered via Mickey Petersen's Mastering Emacs. masteringemacs.org/article/sea