fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

9.8K
active users

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

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!

behold: your new favorite cli too for batch renaming of files and directories via #regex and do it fast *and* safe. i'm very confident.

github.com/shenwei356/brename

also available in #macOS and #linux #homebrew as `brename`

(macOS users that like a GUI: i also use Name Mangler and it lets you 'playground' various methods easily too.)
github.com/shenwei356/brename

A practical cross-platform command-line tool for safely batch renaming files/directories via regular expression - shenwei356/brename
GitHubGitHub - shenwei356/brename: A practical cross-platform command-line tool for safely batch renaming files/directories via regular expressionA practical cross-platform command-line tool for safely batch renaming files/directories via regular expression - shenwei356/brename

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.

Ah yes, the age-old tale of Regex: the #mystical, misunderstood #ogre of the #coding world 🤖. The article bravely ignores 90% of its complexity, claiming if you squint just right, it's actually a friendly #garden #gnome 🧙‍♂️. Just remember, if your regular code takes days and your #regex takes minutes, maybe it's time to 🛠️ refine those coding #skills.
timkellogg.me/blog/2023/07/11/ #Developer #Humor #HackerNews #ngated

timkellogg.meRegex Isn't Hard

Whoever uses #regex should know about this invaluable tool:

regex101.com/

I consider myself a regex expert, and still every now and then I have cases which I can't figure out myself. This tool has never let me down so far... You can of course configure it to operate according to most of the important #regexp "flavors"...

regex101regex101: build, test, and debug regexRegular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.

Do I have #regex experts among my followers: echo "123.4506000" | sed -E 's/(\.[0-9]*[1-9])?0+$//; s/\.$//' is intended to remove trailing 0s when its a number with a decimal point. But when there are no cifers behind the decimal point other than 0s, the whole number shall be stripped of the point and the 0s. What are I am doing wrong? Sharing appreciated.

🚀 Behold the epic tale of Janet's #PEG #module, where the author heroically excludes regular expressions like they're yesterday's news. 💥 Marvel at the labyrinth of #parsing magic that claims to be more readable, but only if you have a PhD in arcane text processing. 📜✨
bakpakin.com/writing/how-janet #Janet #readability #textprocessing #regex #HackerNews #ngated

bakpakin.comHow Janet's PEG module worksAn in depth explanation of pegs and how they work.

You know how you can understand something like Regular Expressions (Grep) well enough to write really complex statements that precisely match the nuanced text patterns you’re hoping to revise, but then 6 months later you look at this RegEx you wrote and can’t parse it at all? Like, literally no idea how it works? As in it-would-be-faster-to-recreate-it-from-scratch-than-to-understand-it-enough-to-change-it-even-slightly?

I feel like that all the time.

[FR]
Arrivée ici début 2025, big up aux @admin de Piaille.fr ! #introduction :
Tombée dans la marmite #OpenSource en 2000, je me nourris de commandes #bash. Fichiers texte, #grep et ses jolies #regex, #ansible, #git, #greasemonkey, les tests auto et la supervision sont tes amis.
Cordes frottées, grattées et frappées, sons soufflés, chantés ou beatboxés, sons électro ou scratchés me touchent. Rien de tel qu'une bonne soirée à jammer / à enregistrer pour un beatmaker / à débarquer sur scène pour accompagner quand il manque un instrumentiste / à repiquer des morceaux entiers sur papier à l'ancienne / à improviser avec les enfants
Engagée #AMAP et pro #CNV