neustradamus, to random
@neustradamus@mastodon.social avatar
mjgardner,
@mjgardner@social.sdf.org avatar

@neustradamus #PCRE continues to be a misnomer; it’s a modified subset of #Perl #RegularExpressions with dozens of differences: https://pcre.org/current/doc/html/pcre2compat.html

It's not "(C)ompatible." Accept no substitutes: https://perldoc.perl.org/perlre

#PCRE2 #PerlIncompatibleRegularExpressions #RegularExpression #RegExes #RegExps #regex #regexp

maxleibman, to RegEx
@maxleibman@mastodon.social avatar

I’ve got an email-parsing project that will require some serious regular expressions.

It’s been a long while since I’ve written any regex. Can anybody recommend any good resources for putting off or avoiding doing it?

benzucker, to RegEx German
@benzucker@maly.io avatar

Any wizards here?
Is there a way to match multiple linebreaks regardless of the content but only if the number of linebreaks exceeds a value like 5?

castarco, to til
@castarco@hachyderm.io avatar

Today I learnt that adding ? after * transforms a expression from being "greedy" into "lazy" (important for performance, safe validators, and protection against DoS attacks).

I don't know how I missed this bit of knowledge for so long. :blobfoxbox:

castarco,
@castarco@hachyderm.io avatar

@barubary

Sure. What follows is a dumb example ( executed in https://regex101.com/ ), but illustrates my point.

In this particular case you could say that ? is semantically required for <script> because we could have more than one, but many times we don't have this distinction and it still affects how many steps the has to perform.

(Sorry for having the text selected in the 2nd image, I was copying it for the alt of the images 😅 )

[Result: 1 match, 75 steps, 0.0ms Regexp (with the ? symbol): /([sS]*?)</script>/gi

Text:

<main> Hello World <script>console.log("hello!"); More stuff Just a decoy!](https://media.hachyderm.io/media_attachments/files/111/914/833/409/432/020/original/3925f50f868f8a82.png)
mgorny, to RegEx Polish
@mgorny@pol.social avatar

Paczka Pythona (nie mylić z wbudowanym modułem re) zbudowana jest w oparciu o szczegóły implementacji CPythona i nie obsługuje poprawnie (i autor zapowiada, że może w końcu zablokować kompilację na PyPy). Jednakże wygląda na to, że wymagająca jej paczka działa bez problemów ze zwyczajnym re.

Dzisiaj przechodzi z łatania w sposób niedoskonały paczki regex, i ignorowania szczególnych przypadków, w których nie zadziała, na rzecz łatania re-assert. Chciałbym wysłać tę trywialną łatkę autorowi, ale — jak już wcześniej narzekałem — dostałem niegdyś bana, autor nie potrafi powiedzieć dlaczego, ale nie przeszkadza mu to uważać bana za sprawiedliwego. Może po prostu proaktywnie banuje devów dystrybucji Linuksa.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8413cf2c2955533fdf212fea3970c99cf193d4a1
https://github.com/mrabarnett/mrab-regex/issues/521
https://github.com/mrabarnett/mrab-regex/issues/404

snacktraces, to RegEx
@snacktraces@hachyderm.io avatar

Need a regex for a MAC address?

On a project a while back I needed one and created it. Thought I would share here with everyone.

https://snacktraces.com/blog/regex-for-mac-address.html

c47, to vim
@c47@chaos.social avatar

https://www.youtube.com/watch?v=cNbcRXKsXfc

OMG!! This one contains so much interesting information about vim and regex stuff 😮 Super interesting... also the problem itself that gets solved is a nice one!! 😺

jpaskaruk, to RegEx
@jpaskaruk@growers.social avatar

What else is as incredibly impressive, and at the same time as horrifically ugly, as #RegularExpressions?

By the way, if you need to detect #chords in a text chord chart, here is the #regex you need:

"A-G?(maj|min|m|M|+|-|dim|aug)?[0-9|11|13](sus)?[0-9|11|13](add)?[0-9|11|13]*(/A-G?)?"

edit: any #Musicians out there, can you think of any edge-case chords I should test/adjust to catch? This will be part of a Free chord chart organizer, hit me with your worst.

#Programming

youronlyone, to RegEx
@youronlyone@c.im avatar

To my fellow #ActuallyAutistics who are also into programming. Can you handle #RegEx / #RegExp?

Up to how much complexity?

When I was younger, it was easy. Today, I have to use a test tool! ^_^;;

#Autistics #Autism #ActuallyAutistic #Autistic #AutismSpectrum #AskingAutistics

@autistics @actuallyautistic

danrot, to RegEx
@danrot@mastodon.social avatar

Generally I like , but there are two huge problems for me with it:

1️⃣ I don't need it often enough, making it hard to remember more complex stuff.
2️⃣ As if 1. would not be bad enough, every tool and language uses a different dialect of it 😩

rich, to StableDiffusion
@rich@mastodon.gamedev.place avatar

Why bother crafting prompts for when this
(?:@)(A-Za-z0-9_?)

reliably generates you a yellow corvette...

fedithom, to IT
@fedithom@social.saarland avatar

Ich mal wieder, und
Ich will per RegEx einen String in einem Dokument finden, der immer mit ABC anfängt. Danach folgt einen unterschiedliche Menge an (unterschiedlichsten) Zeichen, und zum Schluss immer 2 Zahlen.
Ersetzen will ich danach die beiden Zahlen, ohne dass ABC oder der wilde Kram zwischen den beiden angefasst wird.

Geht sowas? Und wenn ja, wie?
(Und: Hab ich das ausreichend gut erklärt?)

(Update: Mittelteil hat unterschiedliche Zahl an Zeichen)

cheeaun, to til
@cheeaun@mastodon.social avatar

/\p{RGI_Emoji}/v via https://github.com/sindresorhus/has-emoji/blob/f8a1f367ecf8e59ec1d71eb18175d7f9ef08bf0d/index.js#L1C30-L1C31 which leads to https://v8.dev/features/regexp-v-flag

  • "The v flag enables all the good parts of the u flag, but with additional features and improvements"
  • RGI_Emoji: “the subset of all valid emoji (characters and sequences) recommended for general interchange”
  • "Although properties of strings are currently gated on the new v flag, we plan to eventually make them available in u mode as well."
marcel,
@marcel@waldvogel.family avatar

@stefan @cybeardjm @cheeaun Since just over a month, all major desktop and mobile browsers should support this (first browser started supporting it in April 2023). So it is still fairly new and polyfills are required for older browsers.

Edit: I thought the article had mentioned polyfill. But it didn't. And it seems hard to polyfill this. So, your code still needs fallbacks 😕

https://caniuse.com/mdn-javascript_builtins_regexp_unicodesets

stealthmusic, to RegEx
@stealthmusic@mastodon.online avatar

always succeeds in surprising me. It has a built-in tester that allows testing and changing the expression directly in your code, dealing with all the nasty escaping that is required in Java. It even highlights matching groups. 💚

jas_hughes, to RegEx
@jas_hughes@fosstodon.org avatar

Day 1 of

Like others, found this one much harder than other Day 1 puzzles: especially with that tricky edge case that wasn't in the examples.

I try to stick with base in my solutions, and it wasn't so elegant for extracting strings.

davidbisset, to php
@davidbisset@phpc.social avatar

"Human-readable regular expressions for " 🤔

https://github.com/gherkins/regexpbuilderphp

hennell, to RegEx
@hennell@phpc.social avatar

This is pretty neat. A better way to in ? 🤔

https://github.com/gherkins/regexpbuilderphp

hamatti, to RegEx
@hamatti@mastodon.world avatar

⭐️⭐️

First day of in the bag with two stars!

Today I used with my solution:

https://github.com/Hamatti/adventofcode-2023/blob/main/src/day_1.ipynb

sabret00the, to RegEx
@sabret00the@mas.to avatar

If I have a string and want to match all characters between the 10th character and the 48th character, what is the proper for that? [A-Z0-9]{10,48} doesn't work 😭

changelog, to rust
@changelog@changelog.social avatar

tailspin is a log file highlighter written in Rust that works by reading through a log file line by line, running a series of regexes against each line. The regexes recognize patterns like dates, numbers, severity keywords and more.

🔗 https://github.com/bensadeh/tailspin

pluralistic, to random
@pluralistic@mamot.fr avatar

Today's threads (a thread)

Inside: Amazon is a ripoff; and more!

Archived at: https://pluralistic.net/2023/11/06/attention-rents/

1/

pluralistic,
@pluralistic@mamot.fr avatar

Dashboard cig lighters are the new cup-holders https://money.cnn.com/2003/11/04/pf/autos/lighters/index.htm

Runner: a game to teach regular expressions to kids https://www.youtube.com/watch?v=fs2ZchTUEvQ

voting machine manual instructs election officials to use and recycle weak passwords https://memex.craphound.com/2018/11/06/unisyn-voting-machine-manual-instructs-election-officials-to-use-and-recycle-weak-passwords/

Steganographically hiding secret messages in fake fingerprints https://memex.craphound.com/2018/11/06/steganographically-hiding-secret-messages-in-fake-fingerprints/

4/

vintprox, to Discord
@vintprox@techhub.social avatar

deserves a set of more performant and native applications than being attributed to a page in 's playbook. Stay with me: are we really just going to blindly accept flaws of this messenger and promote it at the same time?

The fact that it only has got to the head of Discord it's long overdue to verify this popular distribution, I think, is worth a comment on itself, but I'll digress. It is nice that enthusiasts made arrangements for this verification and I have zero disagreements with the result. I'm just stupified that, in all this effort, Discord is treated like some spoon-fed royal baby - at least, according to reactions I see.

So, what was it... Flathub already had a library of nice actively developed before these news. I don't see the point in exaggerating the scales on some centralized chat thingabob with well-known and problems, that's all. Thank you for visiting my talk! ❤

vintprox, (edited )
@vintprox@techhub.social avatar

Just so we're clear: I include direct messaging link in format of https://matrix.to/#/@vintprox:envs.net 👌...which has no trouble with. The reason I even publish DM link instead of my , though, is because YouTube has a meltdown from links containing a second # (number sign, replace @ with it to get into my space).

From technical POV, it's one correct away for YouTube, as many modern social media and video platforms can handle it and do use normal . But, on the other hand, service just shouldn't be employing such flawed pattern or provide an alternative one, even if standard allows the former to exist.

So, yeah, there is that - it is hard to gather video viewers in such a place. It's a single thing that I miss from Discord invite links. Matrix ones don't need a vanity and it's sweet - one solution is put it through , but then the entire point is lost.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • megavids
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • provamag3
  • tester
  • Leos
  • JUstTest
  • All magazines