From f9544958194efb54e2c4f211a632964c488456e8 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 8 Jan 2022 21:20:17 +0530 Subject: docs: readme update for object property example --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 10460c7..f595163 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Example - ```js filter(/ \T (\s | \n) /, [ null, 0, '2', 3, true ]) // > [ '2', 3 ] + +filter(/ \T[name \s\T] /, [ null, 0, { name: '' }, { name: 'phenax' } ]) // > [ { name: 'phenax' } ] ``` @@ -20,7 +22,8 @@ Whitespaces are ignore (exceptions: within string literals and nested regex) * `a|b` => match `a` **or** `b` * `a*` => Zero or more consecutive instances of pattern `a` in the list * `a+` => One or more consecutive instances of pattern `a` in the list -* `(\s\T)` => Group (example matches any non empty string) +* `(\s\T)` => Group (example matches any non-empty string) * `^a$` => `^` indicates start of list, and `$` indicates end of list * `a,b` => match `a` followed by `b` (next item) +* `[name \s\T]` => match property of object (example matches items with property `name` as non-empty string) -- cgit v1.3.1