med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

409
active users

#regex

1 post1 participant0 posts today

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.

[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

Replied in thread

@stilgherrian it’s been a long time since I’ve admin’d a mail server in anger (always in anger… 😜) but I have much recent experience when trying to interact with MTAs & other systems when using plain old plus-addressing that worked perfectly well for decades back when crusty greybeards (👋 honorary greybeard) ran the global infra

the most common / painful variants:

  • sign-up form accepts plus-address email & “completes” the process, but confirmation email never arrives (silently dropped somewhere in the pipeline, I have no way of knowing exactly where) 😩

  • sign-up form has a (crappy) client-side “email address validation” with varying forms of incorrect / incomplete understanding of relevant RFCs, which can almost always be traced back in their web page code to crappy #regex that doesn’t match the full set of RFC-permitted chars 🤬

it’s been so painful that I’ve stopped using plus addressing all together & just reverted to a catch-all email config on my domains (which fortunately my mail provider supports well, I can reply from whatever email something comes in to), as well as masked emails using the provider’s domain depending on use case 💁‍♀️

Replied in thread

@dansup @Gargron Also, the Mastodon filter implementation is anything but powerful since the capability for #RegEx has been removed.
Many things cannot be filtered anymore at all, others need tons of primitive filters what could be accomplished with a single RegEx before.
I still don’t get the reason behind tha removal. It just does not make sense.
#LeSigh

Anybody else download like 1000 TikToks and max out their phones storage and their back up solution? No...yeah...Me Neither.

But if someone did, here's a way to solve it quickly on Android devices.

Since #TikTok names all its video files 32bithexadecimalvalue.mp4, we can us a little #grep and #regex along with #Termux to sort through the #Android #camera roll and delete all the corresponding files.

justinmcafee.com/posts/2025/so

justinmcafee.comJustin McAfee - So You Downloaded a Thousand TikToks

Im trying to provide aliases for #regex definitions so that humans would be able to understand things better scanning my coding.

However, an identifier as terse as `/[^\s\t_-\/\.=<>:]+/` becomes hideously long to describe in english descriptors.

Is there a midpoint reference or shorthand that could serve as a compromise?

I may just provide a vague numbered reference as a hack - but this obviously is ineligent and a recipe for bugs (should I label something else with the same nomenclature)

Mal eine Frage zu #Regex.

Eins hat ja immer mehrere Optionen, wie Regexen geschrieben werden können.

Wenn ich jetzt bspw. folgendes matchen will:

2025-04-03 09:45:52,731 INFO

Mach ich dann eher A oder B?

A: ^[0-9]{4}-[0-9]{2}-[0-9]{2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3}\s{1}(?P<level>[A-Z]*)

B: [0-9-:,\s]*(?P<level>[A-Z]*)

Welche Variante ist denn schneller?
Was ist hier besser?

:BoostOK: :ReplyOK:

Hey, does anyone have recent experience with trying to get an LLM to make regexes for you? Does it work? I hate doing them but I suspect that's an area where I'd still need to be an expert to see that it isn't working.
#regex #LLM

My PhD student was still feeling uncomfortable with #regex, so I searched and found these awesome regex games that can help you improve your regex-fu and help you have some fun during your daily commute:

regexcrossword.com

the-regex-game.com/?level=inte

and this imho is more geared towards beginners:

regexone.com

Regex CrosswordRegex CrosswordA crossword puzzle game using regular expressions. Earn achievements completing puzzle challenges. Easy tutorials for people new to regular expressions.

Pyparsing 3.2.2 cleans up a formerly internal-only utility method make_compressed_re(), and makes it part of the public API. Given a list of strings, it generates a regex to match those strings and only those (so no cheating like ".*").

Here are before/after expressions for matching chemical symbols.

Replied in thread

@bortzmeyer Zig is one of three languages I have my eye on!

- #Zig - Procedural and easier to read than C.
- #Haskell - Functional in the extreme.
- #Rakulang - Can be functional, can be procedural, can be OO. Fantastic grammar / #regex model.

I think they complement each other. Every Haskell guy I have introduced to Raku has loved it. I've known a few people who use Zig when they don't feel like being purely functional.

I have a #regex problem
wikidata.org/wiki/Property:P12 allows " [-]?[1-9]\d* " as the regex for the external identifier. From what I understand, the identifier could then start or not with a - (which is great, because some IDs have it and some haven't).

Except when I try to add the identifier "-24371055" (with the initial -) here inventaire.io/entity/inv:85e76 on @inventaire I get an error message. Inventaire uses #Wikidata properties and constraints.

What am I missing?

www.wikidata.orgNooSFere publisher IDID for a publishing house in the NooSFere database