photog.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A place for your photos and banter. Photog first is our motto Please refer to the site rules before posting.

Administered by:

Server stats:

242
active users

#regex

0 posts0 participants0 posts today

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?

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

#Scrivener and #RegEx search users who are #authors or #writers. I've updated my pattern strings in my Regex Searches for Revision and Proofing document. I fixed some patterns, made them alway case insensitive regardless of your settings, added tests and used them to ensure all the strings work, and updated the instructions.

If you have suggestions for more words, or an idea for a different pattern to add that helps a writer during revision, reply or PM me.

HTH

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 Last Updated 27 June 2025 (Fixed and minimized patterns, added a few words, added tests.) The RegEx string below should work in any editor that supports RegEx search following ICU guidelines (see: https://unicode...

@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.

I love #regex based tools like sed.

Customer wanted me to set up some automation to capture what it was they had previously been doing by hand. One of those hand-jammed components was a custom
#RDS parameter-group that they'd attached to their reference (#postgresql) database. There were a couple-hundred settings in it, so I wasn't jazzed about trying to hand-capture that into a #Terraform or #Ansible workflow.

However, I was able to automate ganking their hand-jammed content and replicate it in a
#Terraform template. First, I combined a couple, nested aws rds … queries to fetch the data. The I wrote a multi-line sed filter to reformat the aws rds … queries' JSON output into TF-compatible config stanzas. Ran the resulting TF module through terraform fmt, terraform validate and then a terraform apply and I suddenly had a new RDS parameter-group in my dev-account that seemingly mirrors what was in the customer's production account. All told, took about half an hour to get the aws queries and, especially, the sed commands worked out. It had initially looked like it might have taken me all day (had I not been able to pipeline it).

@toddalstrom 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 for Speedy Story Revision

Here are the current iteration of these two RegEx search strings. I will update this post to keep it up to date. The \b requires a beginning- or end-of-word to maximize exact matches. The (?: ) is a non-replacing grouping for multiple words with similar issues, and for he/she matches. Depending on your writing, you may want to change the pronouns to he|she|it|they. Both RegEx rely on NOT selecting Case Sensitive for searches.

  • Negative Protection and Homonyms:

can\b|can't|can not|could\b|couldn't|cannot|shall\b|shan'|shall not|shoud\b|shouldn't|should not|would not|\bwould\b|\bwouldn't|\bwith\b|without|write\b|\bright|lead\b|\bled\b|lede|choose|chose|lose|loose

  • Weasel and Hedge Words:

ly\b|\babout\b|almost|already|barely|\bbit\b|begin|\bbegan\b|\can|certain|generally|\bguess|\bjust\b|kind|\blike|maybe|mostly|near|course|pretty|perhaps|possibly|potentially|really|probably|\bseem|\bsome\b|sort|start|\bstill\b|surprisingly|suppose|\bthink\b|usually|could|\bsaw\b|\bheard\b|\bfelt\b|\bknew\b|\bread\b|noticed|recognized|\band\b|\bbut\b|(?:I|he|she) could (?:see|hear|taste|touch)|(?:I|he|she) (?:saw|hear|knew|read|felt|noticed|recognized) that|you can|made certain

If you use #Scrivener, this is the procedure for turning these searches into Binder/Left-sidebar buttons on the Mac, though probably similar on Windows:

  1. Click the combo-button for Search.
  2. Select Search in Project.
  3. Copy-Paste a RegEx string and press Enter.
  4. Note to the left inside the search control there is a magnifier and a combo-button. Open it. Select at minimum RegEx. I also select the name of my drafts folder, which is Manuscript, and Text so only what I want to revise is shown in the binder. Turn off Case Sensitive if on.
  5. Click Save Search as Collection.
  6. Provide a name in the dialog (it initially displays the RegEx string).
  7. Click View > Binder (if not already check marked).
  8. Click View > Collections (if not already check marked).

If you need to update a collection, use this procedure:

  1. Click the RegEx search collection in the binder. This displays it in the search control.
  2. Copy it from the search control.
  3. Press the minus button in the + - shown to the right of Collections. This deletes only the selected existing search collection. There is no way to directly update a search collection.
  4. Paste your revision.
  5. Follow the first set of instructions to recreate the collection.

On the iPad and iPhone, RegEx search exists but only finds a single word or phrase at a time. Disappointing, but it works. You will find RegEx which you tap gear icon when using Find. You can't save the search, but I put it in the Notes app so I can reference it easily.

The image shows Weasel and Hedge Words in use. In the top left, you'll see the search box with the RegEx, and below it my two collections which are titled 🔍Positives and Negatives and 🔍Weasel and Hedge Words. Note the highlights. Desktop Scrivener shows all matches, making quick review and revision a snap. I've added "and" and "but" and "ly" to highlight overuse of conjunctions and adverbs. There's also double-word error highlighted.

May your editing, revising, and review be simple and swift!

#BoostingIsSharing