Skip to content

Commit

Permalink
Betteer flag description
Browse files Browse the repository at this point in the history
Explaining why emojisCustom needs a different flag.
  • Loading branch information
eklem authored Aug 9, 2023
1 parent f8062ee commit 6f7e552
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ extract(oldString, { regex: [email, usernames, words] })
extract(oldString, { regex: [words, usernames, email] })
```

### Predefined regex'es
### Predefined regexes
```javaScript
words // only words, any language <-- default
numbers // only numbers
Expand All @@ -183,6 +183,10 @@ email // email addresses. Most valid addresses,
// but not to be used as a validator
```

### Flags for regexes

All but one regex uses the `giu`-flag. The one that doesn't is the `emojisCustom` that will need only a `g`-flag. `emojisCustom` is added because the standard `emojis` regex based on `\\p{Emoji_Presentation}` isn't able to grab all emojis. When browsers support `p\{RGI_emoji} under a `giu`-flag the library will be changed.

### Languages supported
Supports most languages supported by [stopword](https://github.com/fergiemcdowall/stopword#language-code), and others too. Some languages like Japanese and Chinese simplified needs to be tokenized. May add tokenizers at a later stage.

Expand Down

0 comments on commit 6f7e552

Please sign in to comment.