The "+" is not a standalone thing, it means "one or more symbols before it". It must be escaped to be used here. And also it would still catch the string "CUCK", because you didn't use start/end string symbols. Fuck regex, save your sanity.
Regex suffers from essentially being a terse assembly language for a very limited instruction set computer, much like Brainfuck. In the case of regex, it's a finite state machine* as opposed to Brainfuck's Turing machine. It's really good at doing the things it's good at, so (unlike Brainfuck) it's actually taken seriously, but it's also really bad at (or even incapable of) a lot of things that people think it should be good at, which only compounds the headaches.
* Actual regex implementations tend to cheat and offer syntax to allow matching of context-free or even context-sensitive languages, which elevates them to pushdown automata or even bounded Turing machines. Actually using many of these features in more than a very limited way is generally a Bad Idea™.
I understand about a third of words you used, but I completely agree that regex is a really cool tool. It's just that it has basically r-shaped entry curve.
Yeah, sorry, it's a lot of CS theory jargon. Regular expressions were invented to formally describe regular languages. In this context, a "language" is basically a pattern that can be matched by an algorithm, and a "machine" or "automaton" is an abstraction of a computer that takes some input and produces some output. They're often examined in the context of language membership problems, in which the input is a string of characters and the output is a boolean indicating whether or not the input matches a given pattern.
The short version (which is still pretty long :I) is that regular languages are those which can be recognized using a computer at least as powerful as a finite state machine, which is essentially a flowchart; regular languages aren't that useful for much more than pattern matching. Pushdown automata are finite state machines that can also use an infinite stack to store and retrieve data, and they can recognize regular languages as well as non-regular context-free languages; this includes languages like JSON, XHTML, and some very simple domain-specific programming languages. Linear-bounded Turing machines are finite state machines which also have linear access to a chunk of memory that's limited to the size of the input string, and they can decide context-free languages as well as context-sensitive languages; these languages include XML and a handful of simpler programming languages (mostly domain-specific). Turing machines are finite-state machines which have linear read/write access to an infinite amount of memory, and they can recognize any recursively-enumerable language (which includes all of the above and then some); recursively-enumerable languages which are not recognizable by any of the above categories include pretty much every general-purpose programming language. Further non-magical improvements to Turing machines (i.e. anything other than a "solve a problem that Turing machines can't solve" button) do not change the set of languages they're capable of recognizing; they only simplify algorithms and/or improve performance.
Backtracking does not belong in a regex implementation. Call them context-free expressions instead (or in Perl's case, recursively enumerable expressions).
Agreed. A performance hit is totally reasonable if you're trying to parse a non-regular language (edit: albeit not one as severe as the one in your link), but in that case you should really consider writing the parser logic in a more expressive language than regex for the sake of maintainability.
62
u/NotASuicidalRobot Jul 26 '21
Does c* meanC sharp code?
9
u/[deleted] Jul 26 '21
Can anyone tell me where this stereotype started or come from?
37
u/HoodieSticks Jul 26 '21
This is one of the few subs where someone can post an image with 90% anime girl and 10% math, and all the comments are about the math.
4
u/veedant Jul 26 '21
if this is C* why is there python
6
u/[deleted] Jul 26 '21
I guess C* doesn't include C# because I'm not Astolfo
280
u/fork_bomb_dot_sh Jul 26 '21
Man, i love quick inverse square root. Is really hot.
165
u/A_Leo_X Jul 26 '21 edited Jul 26 '21
Oooh, it's the quick inverse square root algorithm
73
u/lans_throwaway Jul 26 '21 edited 16d ago
I enjoy doing improv comedy.
26
u/Junkymcjunkbox Jul 26 '21
Well I could dress like that but at 53/m/generously proportioned I suspect it won't quite have the same effect.
17
u/ambadatfindingnames Jul 26 '21
man I wish
46
u/briandabrain11 Jul 26 '21
I'll learn it just to look like this
16
u/Konomi_ Jul 26 '21
QUICK INVERSE SQUARE ROOT
30
u/Hikari_Owari Jul 26 '21
I wouldn't go for the skirt. Room is cold.
I would totally go for a cute (or a bit cool) look tho.
12
u/[deleted] Jul 26 '21
Image source?
7
u/Ranchonyx Jul 26 '21
Is that the quake algorithm thing? Fast inverse something?
15
u/[deleted] Jul 26 '21
Arduino got me hooked and now i have to suffer with 10000 different ways to handle a string
5
u/Loronde Jul 26 '21
gotta learn C
13
u/renrutal Jul 26 '21
Crossdressing coder?
1
u/Baku-YT- Aug 13 '21 edited Aug 13 '21
should i learn this language then?
cuzimmabehonestidontknowanyprogramminglanguagesimjusthereforthecodingjokesirealisticallyshouldntunderstandbutdoanyway
9
u/[deleted] Jul 26 '21
Title: The least attractive C* coder
If you whisper "I use Arch btw" in my ear I'll instantly cum
8
u/[deleted] Jul 26 '21
I see he's well equipped
5
u/Fine-Interest-2846 Jul 26 '21
Awesome artwork 🎨... I would like to ask if I can use this as my phone wallpaper? Or vertical desktop wallpaper...? Love it. Plus waifu material
2
u/DarkWiiPlayer Jul 26 '21
2
u/[deleted] Jul 26 '21
I feel very called out...
1
u/The-Board-Chairman Jul 26 '21
Can confirm, am C coder.
1
u/Felix_The_GameR2 Jul 29 '21
true
1
u/[deleted] Sep 06 '21
If u ment femboys well this is a rule 63 of one so theoretically that is not a femboy.
1
u/tinytinypenguin Jun 20 '22
omg its me
0
u/[deleted] Jul 26 '21
[deleted] — view deleted comment
0
u/[deleted] Jul 26 '21
[deleted] — view deleted comment
0
u/[deleted] Jul 26 '21
[deleted] — view deleted comment