leobm, to RegEx German
@leobm@norden.social avatar

The ?x modifier/flag is nice, never used it before.
Makes it possible to include commentary inside complicated patterns.

original source: https://polar.sh/eval/posts/named-capturing-groups-in-clojure

evilchili, to Canada
@evilchili@linernotes.club avatar

Hey Canadian nerds! I have held the domain registration for regex.ca for a very long time. When I lived in Canada it was my primary domain, but I haven't used it for years. Does anyone on the fediverse have a good use for it?

I'm going to release it but if you've got a good pitch I'll pay for a 1 year renewal and then transfer it to your ownership.

Please boost for visibility kthx!

chrastecky, to RegEx
@chrastecky@phpc.social avatar

Lo and behold, fellow mortals of the programmer variety! I find myself embarking upon a most arduous quest.

One that shall test the mettle of my coding prowess... Yes, thee heard right.

I dare to dance with the elusive and powerful entity known as... the #regex #email #validation!

stevensanderson, to programming
@stevensanderson@mstdn.social avatar

🎉 New Post Alert! 🎉

Counting words in a string is a fundamental task in data analysis.

  1. Base R: Use strsplit(), a straightforward method to split strings and count words.

  2. stringr: The str_split() function from the stringr package makes the code more readable.

  3. stringi: For powerful and efficient string manipulation, stri_split_regex() from the stringi package is your go-to.

Happy coding! 🚀

#R #RStats #RProgramming #Programming #regex #Coding #strings

Post: https://www.spsanderson.com/steveondata/posts/2024-05-16/

lizardbill, to RegEx
@lizardbill@hachyderm.io avatar

You can't parse [X]HTML with regex. #regex #html https://stackoverflow.com/a/1732454/1288

villetakanen, to RegEx
@villetakanen@mementomori.social avatar
profoundlynerdy, to raku
@profoundlynerdy@bitbang.social avatar

What are some underappreciated superpowers that and/or has EXCLUDING and ?

NireBryce, to RegEx
@NireBryce@hachyderm.io avatar

does there yet exist any application that can take a multi-selection and spit out a #regex that will match that in any file going forward?

necrosis, to RegEx German
@necrosis@chaos.social avatar

Liebe Informatik Lehrkräfte, bitte bringt euren Schülerinnen und Schülern #RegEx bei.

Es hilft im Job ungemein. 😅
Ich wünschte ich hätte das schon in der Schule gelernt. 🥹

#FediLZ

alter_unicorn, to RegEx
@alter_unicorn@masto.bike avatar
stux, to RegEx
@stux@mstdn.social avatar

How to #REGEX

rdela, to RegEx
@rdela@mastodon.social avatar

Chat log from this morning’s #StaticChronicles with @zachleat + @mikeneu from @cloudcannon, in which I clumsily praise @paulcuth, @robb, and @bobmonsour among others!
https://gist.github.com/rdela/e8facf1a8a31ea5223c42075cbaa9bb2

Follow on Twitch
https://www.twitch.tv/cloudcannoncms

Subscribe on YouTube
https://www.youtube.com/@cloudcannon

Today's ep. https://youtu.be/Pt5CWtEPmBM

Bonus #RegEx I use to clean up the copy pasted Discord chat…

(?# Space out copy-pasted discord chat)  
(?# find )  
^(.+)\n:\s?  
(?# replace )  
\n$1:\n  
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:

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

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."
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)

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