I wrote these to find gets. I have one for the traditional ones like dubs, trips, quads, quints, etc. I also have one expanded for sequences like 123123. The expanded one can't do something like 112233 though. I think 123456 is also a pretty special get. Could we have an expression to get all of these without using OR?
AFAIK I've seen that one before and it doesn't handle nested comments (legal RFC 822 syntax). Email address parsing is a great example of why regexes are shit for parsing.
Brody Thompson
It's a highly expressive and specialized language. That's the tradeoff it makes.
The alternative would be having some monster like startLine(), repeat(any('a','b','c'),0,infinity), endLine() for doing what could be done with ^[abc]*$
James Cook
[/code], not [\code]. RegEx is really useful, claims by a linux a/s/g user here. Though it looks confusing when it's bloated enough since there's no extra characters allowed in regex, but it can deal nearly any types of text processing.
Aiden Ward
Oops.
gets (\d)\1+$ gets++ (\d+)\1+$
I can't believe I made such a shitty OP. I forgot reduce my image size too.
Since you guys like regex so much, I might come back later with some finite automata, and we can practice translating them to grammars and regex. I can't right now though.
Samuel Hill
Oh, I'm not saying I don't like it. It's just blowing my mind. I didn't know something like this even existed until this thread.
Matthew Myers
fun way to learn regex regexcrossword.com/ or you could try regex golf but it's a bit shit
Samuel Allen
Actually, that looks pretty nice. It would be cool to have a program that can generate a regex from a more human-readable language. I think LISP S-expressions would work pretty well for this. Well, now I have an idea for what to do when I'm further into SICP.
Adrian Cooper
I tried making a regex generator for normies, but it's more difficult that I expected.
Zachary Mitchell
What are grok patterns?
Joshua Perez
Fun challenge: Make an XML parser in Regex.
Ian Fisher
10 / 10 would do again
Charles Torres
Best regex meme.
Also ITT: kripplecice fix ur shit
Charles Brown
Nice snipe hunt. The reason why regular expressions can't parse XML is in the name. I've worked on a pushdown automata for parsing JSON and XML before.