eupolicy.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
This Mastodon server is a friendly and respectful discussion space for people working in areas related to EU policy. When you request to create an account, please tell us something about you.

Server stats:

196
active users

#regex

0 posts0 participants0 posts today

Asking for an opinion from all my #python friends. The non-work Python project I'm developing has a few places where I need to find the most recent text above the current position that matches a #regex. I can either:

- Require the non-standard regex module (pypi.org/project/regex/) which has a REVERSE flag

- Create a "match all the things from the beginning, but then only use the one whose match.start() is before the current position

The first is clearly cleaner, but requires users to add one more module (they're already needing to add two others for different stuff in the program). The second is a tad kludgy, slower (but only by maybe a tenth of a second), but requires no additional includes.

Opinions? Strong opinions? First-hand experience with the regex module?

pypi.orgClient Challenge
Replied to Natasha Nox 🇺🇦🇵🇸

@Natanox Since it was like the 2nd thing I learned when I was super psyched about my first hacking adventures, I always laugh at these #regex intimidation memes. I think my love of them came from just actually being able to get magical-seeming sysadmin shit done. I can't imagine anything like regex that wouldn't be as intimidating as regex; the fact is that with great succinct surgical text processing power comes great great succinct surgical text processing trial and error.

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!

SYSTEMF @ EPFL · Adding lookbehinds to rust-lang/regex – SYSTEMF @ EPFL
More from SYSTEMF lab

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?

@jwildeboer

My guess is #ReGex:

In regular expressions, the underscore counts as a "word character", whilst dashes, commas, dots, whitespaces etc. count as "non word characters".

This is a hugely important thing: All relevant APIs rely heavily on RegExes.

I'm afraid, your initiative won't succeed for that reason:

All #ActivityPub software would have to be revised and patched to solve a niche annoyance.

My bet: It ain't gonna happen.

@Gargron @evan

Replied in thread

@timbray my first job out of uni was parsing hand coded html with perl.
It has proven, this far, to be both impossible to do perfectly and a fantastic source of job security.

(Yes I use Python NLP pipelines and such these days but still...)

This is a good overview of how regex works

“Regex is a pattern-matching language; it’s a way to expressively describe patterns that match strings (e.g., words or sentences). For example, say you’re searching your hard drive for an image called foo, but you cannot remember if it’s a JPEG or a ...continues

See gadgeteer.co.za/this-is-a-good

GadgeteerZA · This is a good overview of how regex works“Regex is a pattern-matching language; it's a way to expressively describe patterns that match strings (e.g., words or sentences). For example, say you're

Attention Scrivener users, and anyone with RegEx search in your editor:

I have three comprehensive RegEx search strings that you can use and optionally make a collection in Scrivener: (1) Negative or positive words, (2) Confused words, and (3) Weasel and Hedge words.

The Google Doc contains full instructions to create collections for fast access, as well as the strings. In the future, I will update this document as I add words.I will take suggestions!

docs.google.com/document/d/1-g

#BoostingIsSharing

Google DocsRegex Searches for Revision and ProofingRegex Searches for Revision and Proofing By R.S. @sfwrtr@eldritch.cafe on Mastodon The RegEx string below will work in any editor that supports RegEx search. The following is targeted toward Scrivener. This discussion is for the Mac desktop version, but the Windows desktop probably works the same...
Replied in thread

@GratianRiter

Das Tool #spov ⬆️ hat übrigens die Motivation, die #Diskussionskultur in den sozialen Medien durch mehr Übersichtlichkeit zu verbessern. Man kann den Antwortbaum damit auch nach Usern, Hashtags anderen Zeichenketten filtern, seit kurzem funktionieren sogar sog. "reguläre Ausdrücke" (#RegEx)

Es ist ein Projekt im Rahmen von @kddk. Hintergrund-Überlegungen:

kddk.eu/selbstverpflichtung/

Ggf. relevant zu erwähnen: Es ist eine Web-Applikation, #FreieSoftware und lässt sich sehr einfach selber hosten. Die Demo-Instanz auf spov.kddk.eu/ steht allen frei zur Verfügung.

Après quelques recherches j'ai compris qu'il pouvait y avoir un certains défis à réintroduire les #regex sur #mastodon que ce soit par la complexité d'utilisation ou le ralentissement les services avec possible faille #DDOS le risque est le taille.

Personnellement, j'aurais bien aimé avec a profiter des nombreux avantages qui en découle malgré tout. Et j'ai cru comprendre qui que beaucoup de #moderation en aurait apprécié l'efficacité.

1/n

framapiaf.org/@JBrickelt963/11

FramapiafJBrickelt963 (φ) (@JBrickelt963@framapiaf.org)@toddalstrom@mastodon.social oh je découvre qu'il est possible d'ajouter des expression "Regex" dans les filtres Mastodon !? L'expression pour Thread me sera sans doute moins utile maintenant qu'il est bien largement défédéré, mais ça ouvre le champ des possible. EDIT : Zut voilà que je déchante en apprenant que ça l'était jusqu'en 2018 dans l'implémentation officielle ... #Regex #Mastodon #Fediverse #feditips
Replied in thread

@PragmaticAndy Ive felt the same myself - pedantry for writing comms helped my coding skills alot.

However, while Python is useful in order to have an experiment it provides a ceiling.

Would this be the case for using #regex for instance?

Or multi dimensional arrays in Gawk?

My recent obsession with the #OscarMamen travel logs of his journey(s) to & time in #Mongolia #BogdKhanate, I wrangled data from a photo archive database.
For unknown reasons, the database doesn't have a field for "date". All date info is stored alongside content descriptions of the photos and their location in the physical archive in the free-text field "motive description".
To work through 7.500 photos + matching them to log entries, I re-taught myself #regex & @OpenRefine
Can recommend!

I still can't believe that most programming systems we use today are preoccupied with numbers. AFAIK, half of (R5RS?) #Scheme standard is numbers and operations on them. Same for #C, #CommonLisp, #Java—ten different types of numbers and huge libraries for them.

Humans think in images and words. Structured text-oriented languages feel like a much better fit for everyone not corrupted by C. Yet we have little to no popular attempts in that space. Structured Regular Expressions didn't catch up; #ed1 and #awk are considered mere #regex automation tools. Modal and the term rewriting systems have their Merveilles Town, but not much beyond. sh/#bash and the like are quite successful, but aren't considered real programming languages either.

Why.