Live data from Hacker News

Show HN: RegEx for Regular Folk – A visual, example-based introduction

refrf.shreyasminocha.me

81–90 of 113 posts

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#81
post #78

I think what regex's need is a really powerful syntax and language aware regex editor. I've been using regexs for most of my career, and still struggle to get them right on first writing. The #1 problem I run into is: what is a literal character and what is a control character? for example, both these are very common: - match a parenthesis character or a period character - use a parenthesis to group a match or use a…

I use regexbuddy and it does a lot of this. Huge downside is that it's $40 and Windows only.

You can do things like write a more generic regex and then select your language (e.g Python 2 or 3, Java, Perl, so on), And a few common actions, such as "iterate over all matches in a string" and it will auto-generate a code stub for you. Whenever teammates of mine are working on a weird regex they usually email me to double check it for them. (My response is usually that they're trying to do too much with one regex, haha)

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#82
It seems the “next” button is not working on mobile safari on ios 13. It just reloads the page you’re in. Tried with and without content blockers.

However from what i quickly read from the links on the front page, the tutorials itself seem really high quality!

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#83
post #78

I think what regex's need is a really powerful syntax and language aware regex editor. I've been using regexs for most of my career, and still struggle to get them right on first writing. The #1 problem I run into is: what is a literal character and what is a control character? for example, both these are very common: - match a parenthesis character or a period character - use a parenthesis to group a match or use a…

Does this help?

https://regex101.com

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#84
Your examples use * and $ and + before they are explained. Inductive learning goes smoother if new concepts have context.

You explain [^ ...] So the use of these examples without explanation is .. unexpected. If you use examples which don't depend on * or + or $ I agree it's 'boring' but for a class of learner these surprise moments interfere with learning.

You only casually mention capitalised \thing is inversion of \thing \d and \D I think you would want to repeat that \w and \W and \s and \S and after three.. it's established.

I see this a lot in e.g. Haskell tutorials: simple inductive constructive learning examples littered with 'oh I explain that later just ignore it for now' syntactic constructs.

\( and \) are dangerous in substitution. Their meaning shifts from regex to variable-marker. Surely this needs to be noted in passing?

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#85
post #78

I think what regex's need is a really powerful syntax and language aware regex editor. I've been using regexs for most of my career, and still struggle to get them right on first writing. The #1 problem I run into is: what is a literal character and what is a control character? for example, both these are very common: - match a parenthesis character or a period character - use a parenthesis to group a match or use a…

I don't see the problem here. The regex itself is exactly the same, it's just that different languages have different string literal syntaxes (and some have dedicated regex syntax, thus solving the problem of double-escaping).

The only regex engine where this is a problem is Vim's, because there are characters that a special unless escaped, and characters that are normal but become special when escaped. And as if that wasn't enough, there are config options to determine which characters those are. My usual practice is to prefix all Vim regexes with \v so that all the special characters are at least consistent.

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#86
Hey this is great!

I noticed that in the "Escapes" chapter, the "Next" link at the bottom of the page goes back to the introduction when it should go to "Groups".

I poked around in your repo to try and submit a pull request, but I can't tell where the edit needs to go; the meta.json file seems to have an array with the right chapter headings which was my guess about the problem.

Anyway, there is a typo. Sorry I can't be more helpful when you've put together such a great resource.

https://github.com/shreyasminocha/regex-for-regular-folk/blo...

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#88
Great regex tutorial: https://www.princeton.edu/~mlovett/reference/Regular-Express...

Good regex book: https://www.amazon.com/gp/product/0596528124/

Good regex website: https://www.regular-expressions.info/

Interesting regex links: https://github.com/aloisdg/awesome-regex

Re: Show HN: RegEx for Regular Folk – A visual, example-based introduction

#89

It seems the “next” button is not working on mobile safari on ios 13. It just reloads the page you’re in. Tried with and without content blockers. However from what i quickly read from the links on the front page, the tutorials itself seem really high quality!

Same on Firefox!
Post reply on HN