summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2022-01-08 19:47:01 +0530
committerAkshay Nair <phenax5@gmail.com>2022-01-08 20:31:13 +0530
commit84b3cb464fd78c5d381324db244c6a5d9bcd698d (patch)
tree6ef0125ad7779a03d7a0617f4207891b9b2a555a /README.md
parenta9f13b737ba89f79409f12f0678b07d34b974ab1 (diff)
downloadelxr-84b3cb464fd78c5d381324db244c6a5d9bcd698d.tar.gz
elxr-84b3cb464fd78c5d381324db244c6a5d9bcd698d.zip
docs: basic readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..10460c7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,26 @@
+# ListExp [ WIP ]
+
+Regular expression-like syntax for list operations
+
+Example -
+
+```js
+filter(/ \T (\s | \n) /, [ null, 0, '2', 3, true ]) // > [ '2', 3 ]
+```
+
+
+### Syntax
+Whitespaces are ignore (exceptions: within string literals and nested regex)
+
+* `\s` => Any string
+* `\n` => Any number
+* `\b` => Any boolean
+* `\T` => Any truthy value
+* `\F` => Any falsey value
+* `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)
+* `^a$` => `^` indicates start of list, and `$` indicates end of list
+* `a,b` => match `a` followed by `b` (next item)
+