Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular expression capturing groups #54

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Curated list of awesome [Template Literal Types](https://devblogs.microsoft.com/
- [Privatized](#privatized)
- [Join](#join)
- [Extract all paths from object](#extract-all-paths-from-object)
- [RE capture groups](#re-capture-groups)
- [Repeat](#repeat)
- [Schummar-translate](#schummar-translate)
- [kysely](#kysely)
Expand Down Expand Up @@ -296,6 +297,16 @@ Type safe `ReadonlyArray<string>.join`

[Tweet](https://twitter.com/wcandillon/status/1409503819575275531)

### RE capture groups

[![types-re on GitHub](https://img.shields.io/badge/GitHub-edwinm%2Ftyped--re-blue)](https://github.com/edwinm/typed-re) [![typed-re date example](https://img.shields.io/badge/Playground-143?logo=typescript&color=3178C6&logoColor=fff)](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbxAQxgYwBYF84DMoQhwBEMAnmAKYAmAtFJcQNwBQLA9J13ACKqVxKAD2TgANgK5c2aCADsAzvGr8ASgIC8JABQB+ADxlKyKAD4AOueoIALFgCUtPfpDyYGC1YQAmB04MqZJ7WvvbMMvJKcCowlACyqJhwWijoGNrE3gAM3ja0AIxZtN4AHMQANNFqlPasEYoQEgB0YhAA5tox8YkYuk1tBACuYApNgbVwnHAA8gDSbFOyDc2tHV0JaX0DEMOjGDtQEwCiqqrTqmyXUlNHKMBigiLiktf1UXdi6skkAHrOgwpKFA5KJKKYANrIWgALwAgrQAFpFACcTQA+gBSADUtAAulj7AABZzUQjIYByCFQuGIlFNPFYyxNSEw+EI3E+coOAAkxDe8A+GySKR6GRQUAA1oThKIwM1ZCAKnAPupam9GpQWu1tIKelshiMmgCgSCQDUmJN2DN5hwrUsFBqtR1dZt+ga9hAlMdTucgA)

Type safe regular expression capturing groups

<img src="./images/typed-re-date-example.png" alt="Type safe capture groups when parsing a date">

[Tweet](https://twitter.com/edwinmdev/status/1842123320960893104)

### Repeat

<p align="left">
Expand Down
Binary file added images/typed-re-date-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.