question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

regex: grouping missing from the curriculum

See original GitHub issue

We teach something obscure as lookahead, but not the more often used grouping for the sake of subexpression choice, eg. a(bc|def)g.

Grouping is indirectly taught for capture groups and lookahead, but plays the same general role in both, capturing or not. So this lesson would fit nicely before that, after character groups.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lynxlynxlynxcommented, Nov 13, 2018

Oh, if I wasn’t clear: I believe an extra lesson is in order, right after the OR one. Maybe something like “find all the words that have ‘foo’ or ‘bar’ in them”, just long enough to avoid character-list hacks.

0reactions
lynxlynxlynxcommented, Nov 21, 2018

Knock yourself out. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regular expressions: some groups missing - Stack Overflow
Capturing groups are indexed from left to right, starting at one. Group zero denotes the entire pattern, so the expression m.group(0) is ...
Read more >
Missing part of special group in regular expression - CodeQL
One of the problems with using regular expressions is that almost any sequence of characters is a valid pattern. This means that it...
Read more >
Regular Expressions: Regexes in Python (Part 2)
In the above example, the regex on line 1 contains two capturing groups, so re.findall() returns a list of three two-tuples, each containing...
Read more >
How to Use Regular Expressions in JavaScript - freeCodeCamp
Regular expressions (regex) are a useful programming tool. They are key to efficient text processing. Knowing how to solve problems using ...
Read more >
Regular Expression in Python with Examples | Set 1
A Regular Expressions (RegEx) is a special sequence of characters that uses a search pattern to find a string or set of strings....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found