Any #regex 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?
#TIL Today I learnt that adding ? after * transforms a #regex 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:
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 #regex has to perform.
(Sorry for having the text selected in the 2nd image, I was copying it for the alt of the images 😅 )
<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)
Paczka Pythona #regex (nie mylić z wbudowanym modułem re) zbudowana jest w oparciu o szczegóły implementacji CPythona i nie obsługuje poprawnie #PyPy (i autor zapowiada, że może w końcu zablokować kompilację na PyPy). Jednakże wygląda na to, że wymagająca jej paczka #ReAssert działa bez problemów ze zwyczajnym re.
Dzisiaj #Gentoo 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.
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!! 😺
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.
Generally I like #RegEx, 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 😩
Ich mal wieder, #IT und #RegEx
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)
@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.
#IntelliJ always succeeds in surprising me. It has a built-in #RegEx 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. 💚
If I have a string and want to match all characters between the 10th character and the 48th character, what is the proper #regex for that? [A-Z0-9]{10,48} doesn't work 😭
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.
#Flathub deserves a set of more performant and native applications than being attributed to a page in #Discord's playbook. Stay with me: are we really just going to blindly accept #privacy 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 #Flatpak distribution, I think, is worth a comment on itself, but I'll digress. It is nice that #OpenSource 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 #FOSS#applications before these news. I don't see the point in exaggerating the scales on some centralized chat thingabob with well-known #ToS and #telemetry problems, that's all. Thank you for visiting my #dRBBoard talk! ❤
Just so we're clear: I include #Matrix direct messaging link in format of https://matrix.to/#/@vintprox:envs.net 👌...which #YouTube has no trouble with. The reason I even publish DM link instead of my #MatrixSpace, 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 #RegularExpression away for YouTube, as many modern social media and video platforms can handle it and do use normal #regex. But, on the other hand, #MatrixTo service just shouldn't be employing such flawed #URL pattern or provide an alternative one, even if #URI 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 #URLShortner, but then the entire point is lost.
Remove multiple empty lines in code/text at once with Regex (www.jucktion.com)
Regex pattern to remove or replace empty lines in your code or text files to reduce the file size. Works in Sublime Text, Notepad++, VSCode…