Earlier quoted context omitted.
-> start_of_line -> literal('Flippers') -> literal(':') -> optional -> whitespace_char -> end -> remember -> multiple -> digit; I literally can’t parse this as a whole. /^Flippers:\s?(\d+)/ is so much more obvious compared to that utter nonsense.
Like most code, it's easier to write regex than to read it later. In my recent vim history: /(\([^()]\|\n\)*\n\([^()]\|\n\)*) This was from two days ago. I think I was searching a huge sheet of regex match groups for any having line breaks to join. In a month, I'm not even sure I would recognize that I had authored this.
Learn RegEx step by step, from zero to advanced
101–110 of 114 posts
Re: Learn RegEx step by step, from zero to advanced
#102An example from 21/55:
"To express at least a certain number of occurrences of a character, we write the end of the character at least how many times we want it to occur, with a comma , at the end, and inside curly braces {n, }. For example, indicate that the following letter e can occur at least 3 time."
It should read something like:
"To express a match of a minimum number of character occurrences, we use a comma after the number of occurrences, within the curly braces {n, }. In the following, try building a regex to match the letter e occurring a minimum of 3 times sequentially."
Re: Learn RegEx step by step, from zero to advanced
#103there's a bug when entering text into the regex area which creates new padded elements show up which makes text on the page shift, e.g. https://i.imgur.com/AFBccIn.gif
the line height in the subtitle area could be increased so the text isn't so cramped ( https://i.imgur.com/HReADcS.png )
the background color of the entire page should be darker (or use some other solution) to make the looking text more distinct as code text. ( dark grey on dark blue doesn't really stand out https://i.imgur.com/8Nt9YNl.png )
Re: Learn RegEx step by step, from zero to advanced
#104cool site and idea, here's 3 site UI suggestions there's a bug when entering text into the regex area which creates new padded elements show up which makes text on the page shift, e.g. https://i.imgur.com/AFBccIn.gif the line height in the subtitle area could be increased so the text isn't so cramped ( https://i.imgur.com/HReADcS.png ) the background color of the entire page should be darker (or use some other soluti…
Re: Learn RegEx step by step, from zero to advanced
#105Re: Learn RegEx step by step, from zero to advanced
#106Re: Learn RegEx step by step, from zero to advanced
#107Btw: Lexer-less derivation parsers are interesting because of how simple they are to write and maintain. IIRCBIMW, they are neither LL or LR.
Re: Learn RegEx step by step, from zero to advanced
#108Re: Learn RegEx step by step, from zero to advanced
#109I learn regex just before I need it. Every. Time. After 25 years, it just doesn't stick.
Try this. Worked for me. https://www.executeprogram.com/courses/regexes
Re: Learn RegEx step by step, from zero to advanced
#110I respect regex for being a widespread DSL that makes certain things very declarative. My problem with it (other than all the different flavors—that’s just history’s fault) is that you don’t tend to get integrated help/tool support for them. They are often just plain strings—how is e.g. Intellij supposed to spot them reliably and help you? It’s too bad if we have to copy and paste regex strings into websites in order…
It depends on the language. JavaScript has a dedicated RegExp object. If you use the literal notation or constructor, you will always get IntelliJ support (unless you decide to use the constructor and extract the regex string for whatever reason). I _think_ you could also mark a standalone string variable with JSDoc to get IDE support, too.