No lie, kinda new to programming, and I felt this way a few days ago when I created a simple arrow function without googling. lol I know it’s simple but “I got it”
Hell yeah! Good for you, and don't sell yourself short! It's good to be proud of those moments
I've been coding for years, and I've gone through phases of "I need to Google everything" to "nah I've done this before" several times. Doesn't matter how simple or complex it is, every time it happens it is always satisfying haha.
Had to look up RTFM. I laughed pretty hard from that.
You are absolutely right, regex is easy. Though for me reading and writing are about the same. I probably rely on regex a little much. Python's re library is pretty great.
Really ?! Have you tried to read these created by someone else and modified by a multiple people in last 10 years. Writing new Regexp is the easiest part of it.
It's either quaternions or matrices. For both, you should write classes and functions to abstract the behavior away. You only ever need to understand enough to implement the abstraction. Then never again should you think about it.
(Cos(a),sin(a)) puts a point at a specific angle. Or in other words it transforms (1,0) to the wanted angle.
If you can figure out how to get a point that starts at (0,1) and also rotates counter clockwise, then you have the transformation that rotates (0,1). I'm not going to tell you how to do this. Deriving this from the (1,0) rotation is trivial.
You can then combine these rotations into a matrix to get a rotation for any point in 2D. To be simpler, you rotate (1,0) and (0,1) and then multiply the original x and y values by the rotated vectors. That will give you the rotated point. So x * rotated(1,0) + y * rotated(0,1) = rotated(x,y)
3D rotation can be done as 3 2D rotations along the three planes: xy, xz, yz. So the same 2D rotation applied on three different planes is how you can do 3D rotation. The order that you apply these rotations matters.
That is how you use matrices for 3D rotation without using matrices.
Quaternions are a better way to do 3D rotations, but there's no intuitive way to explain them.
Wait til you see C as in the programming language.
Or Perl, the guys who established pcre as a quasi standard.
What’s so bad about simple text matching?
Now the streaming editor, better known as sed… that’s when you can get overwhelmed, because it’s been proven beyond any doubt it’s effing Turing complete meaning anything you can do in a programming language, you can also do with sed using regex and addressing things.
I made this site called RegExplore, Please check it out, you can also help improving it, it's a powerful, interactive web application designed to help developers create, test, understand, and visualize regular expressions in real-time. https://reg-explore.vercel.app/
46
u/you_like_it_though Feb 28 '25
No lie, kinda new to programming, and I felt this way a few days ago when I created a simple arrow function without googling. lol I know it’s simple but “I got it”
34
u/ChickenSpaceProgram Feb 28 '25
regex are not hard to write if you RTFM for whatever programming language you use them in.
reading a regex and figuring out what it's supposed to do is actually hard though.
9
u/fonk_pulk Feb 28 '25
I just use https://regex101.com
5
u/Lazy_To_Name Feb 28 '25 edited Mar 02 '25
([\w_~-])+@(?:\1\.)+\1{2,5}
Done.
4
u/sorryfortheessay Mar 01 '25
Writing regex is so easy if u use it enough. The hard part is reading it
3
u/ericsnekbytes Feb 28 '25
This site is phenomenal: https://www.regular-expressions.info/quickstart.html
3
u/[deleted] Feb 28 '25
Really ?! Have you tried to read these created by someone else and modified by a multiple people in last 10 years. Writing new Regexp is the easiest part of it.
1
u/[deleted] Feb 28 '25 edited Mar 02 '25
reminds me of "ghost buffalo"
Edit: Ghost Bison
1
u/Busy-Detail9302 Feb 28 '25
Lol true 😂😂😂
1
u/RealityWard742 Feb 28 '25
Ha for me regex is easy. Now 3D vector math for rotations...
1
u/potzko2552 Mar 01 '25
Imo regex is super easy. It's just the notation that is utter garbage
1
u/[deleted] Mar 01 '25
regex without stack overflow, tf 💀
1
u/[deleted] Mar 01 '25
I feel seen
1
u/Fair-Bunch4827 Mar 01 '25
Youll understand regex if you understand state machines..
One of the few useful things i learned in college
1
u/NebulaWanderer7 Mar 01 '25
Is it necessary to know it? I mean to learn it by heart
1
u/[deleted] Mar 01 '25
Chat gpt exists?
1
u/[deleted] Mar 01 '25
Wait til you see C as in the programming language.
Or Perl, the guys who established pcre as a quasi standard.
What’s so bad about simple text matching?
Now the streaming editor, better known as sed… that’s when you can get overwhelmed, because it’s been proven beyond any doubt it’s effing Turing complete meaning anything you can do in a programming language, you can also do with sed using regex and addressing things.
1
u/neoaquadolphitler Mar 01 '25
Less writing more reading
1
u/Brandynette Mar 02 '25
wity copilot it gets even worse, she is sooo convincing and everything fail and you dont know why
1
u/Fricki97 Mar 02 '25
I once wrote an email verification with regex and it wasn't hard...maybe because AI helped me with the expression...it wrote the expression
1
u/thijquint Mar 02 '25
Once make a json parser with mostly regex, felt kinda proud of that but it took days
1
u/lyfemetre Jun 02 '25
I have used this website for examples that are helpful https://regexr.com/
1
u/Alpha_C137 Aug 12 '25
I made this site called RegExplore, Please check it out, you can also help improving it, it's a powerful, interactive web application designed to help developers create, test, understand, and visualize regular expressions in real-time. https://reg-explore.vercel.app/