{"id":19007969,"url":"https://github.com/jbee/lex","last_synced_at":"2026-04-23T03:30:16.480Z","repository":{"id":138883075,"uuid":"110700004","full_name":"jbee/lex","owner":"jbee","description":"Linear expressions - simple and fast pattern matching","archived":false,"fork":false,"pushed_at":"2018-07-04T06:57:34.000Z","size":46,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T20:26:36.241Z","etag":null,"topics":["interpreter","java","language","pattern-matching"],"latest_commit_sha":null,"homepage":"http://jbee.github.io/lex/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbee.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-14T14:22:42.000Z","updated_at":"2024-01-08T12:08:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"95e24fcb-a0b0-49a2-9443-714774e6957f","html_url":"https://github.com/jbee/lex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee%2Flex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee%2Flex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee%2Flex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee%2Flex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbee","download_url":"https://codeload.github.com/jbee/lex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240035555,"owners_count":19737601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["interpreter","java","language","pattern-matching"],"created_at":"2024-11-08T18:40:00.391Z","updated_at":"2026-04-23T03:30:16.435Z","avatar_url":"https://github.com/jbee.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"▓   ▓▓▓ ▓ ▓\n▓   ▓   ▓ ▓ \n▓   ▓▓▓  ▓\n▓   ▓   ▓ ▓\n▓▓▓ ▓▓▓ ▓ ▓ Linear expressions\n\nFirst match pattern matching with a tiny bytecode instructed matching machine.\n\nSpec      http://jbee.github.io/lex/\nFeedback  http://github.com/jbee/lex/issues\n\nCopyright (c) 2017 Jan Bernitt\n\n\n________________________________________________________________________________\n\nIMPLEMENTAIONS\n\nJava: basic ~100 LOC, optimized ~150 LOC\n\n\n________________________________________________________________________________\n\nSETS         {...}\n\n{abc}        a set of bytes \"a\",\"b\" and \"c\"\n{^abc}       a set of any byte but \"a\",\"b\" and \"c\"\n{a-c}        a set of \"a\", \"b\" and \"c\" given as a range\n{?}          a set of *all* non ASCII bytes\n\n\nSPECIAL SETS\n\n# = {0-9}    any ASCII digit\n@ = {a-zA-Z} any ASCII letter\n$            any ASCII new line (\\n or \\r)\n_            any ASCII whitespace character\n^            any byte that is not an ASCII whitespace character\n?            any single byte\n\n\nREPETITION   x+\n\n+            try previous set, group or literal again\n\n\nGROUPS       (...), [...], `...`\n\n(abc)        a group with sequence \"abc\" that *must* occur\n[abc]        a group with sequence \"abc\" that *can* occur\n`            exit group, unless first in group (used to embed)\n\n\nSCANNING     ~x\n\n~            skip until following set, group or literal matches\n\n\nESCAPING\n\n\\            escape following byte to a literal (also in set)\n\nSets can also be used to match most of the instruction symbols literally.\nFor example {~} is similar to \\~ or {\\~}.\n\nAny other byte (not {}()[]#@^_$+~?`\\) is matched literally. \nEscaping can be applied to any byte even if it is not needed.\n\n________________________________________________________________________________\n\nEXAMPLES\n\n####/##/##        a date of format yyyy/mm/dd\n##:##[:##]        a time of format hh:mm or hh:mm:ss\n#+[.#+]           a simple floating point number with optional decimals\n\"{^\"}+\"           a quoted string using a set to find the end\n\"~\"               a quoted string using a scan to find the end\n\"~({^\\\\}\")        a quoted string using a scan with escaping support\n\\$@}a-zA-Z0-9_{+  a php style identifier\n[\\+]#+[{ -}#+]+   international phone numbers\n~(Foo)            searching for \"Foo\" (e.g. in a file)\n~(\u003ch#\u003e)           searching for \"\u003ch0\u003e\" to \"\u003ch9\u003e\"\n~(\u003ch{1-6}\u003e)       searching for \"\u003ch1\u003e\" to \"\u003ch6\u003e\"\n~(Foo~(Bar))      searching for \"Foo\"s followed by \"Bar\"s\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbee%2Flex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbee%2Flex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbee%2Flex/lists"}