Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joaopcm/regular-expressions
https://github.com/joaopcm/regular-expressions
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/joaopcm/regular-expressions
- Owner: joaopcm
- Created: 2022-10-06T20:13:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-06T20:14:53.000Z (over 2 years ago)
- Last Synced: 2024-12-22T05:29:35.464Z (about 1 month ago)
- Language: Shell
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Regex study
Tip: use [Regex101](regex101.com) website to create your regular expressions :)
### Example 1
#### Regex:
```
^\d{3}.\d{3}.\d{3}-\d{2}$
```#### Data:
123.123.123-12321.123.345-20
200.300.500-19
#### Removing special chars:
Replace [.-] with empty---
### Example 2
#### Regex:
```
^(\w+),\s(\w+)$
```#### Data:
Melo, JoaoWendel, Erick
Gomes, Rhaiany
#### Generate a JSON with first and last names:
Replace `^(\w+),\s(\w+)$` with `{firstName: "$2", lastName: "$1"}`### Example 3
#### Regex:
```
\[(.*?)\]\(([http|https].*?)\)
```#### Data:
```txt
[Erick Wendel](https://erickwendel.com) faz palestras e você deveria seguí-lo lá no [Twitter](http://twitter.com/erickwendel_) ou até no [Instagram](https://instagram.com/erickwendel_)Ah, e você pode também pesquisar no [Google](https://google.com) ou
[Yahoo](https://yahoo.com)Vai que vai!
```#### Generate an HTML based on the markdown text:
Replace `\[(.*?)\]\(([http|https].*?)\)` with `$1`