Skip to main content

An alternative way to write regular expression and a lexer using them.

Project description

Weyland

Weyland provides an alternative way to write regular expression (regex) and a lexer using them.

Syntax of regular expression

In Weyland, we call regular expression rex instead of regex to differenciate them.

Sequence

ab means a then b

Choice

[ab] means a or b

Option and repetition

  • a?b means b or ab (a is optionnal, it can appear between 0 and 1 time),
  • a+b means ab, aab, aaab, aaaab, etc. (a is mandatory, it must appear betweean 1 and X times),
  • a*b means b, ab, aab, aaab, aaaab, etc. (a is optionnal, it can appear between 0 and X times).

Special chararacters

  • # means any digits
  • @ means any letters
  • $ means any digits, letters and the underscore character (_)
  • . means any characters which is not a new line

Limitations

  • In a choice, you can only choose between one element not between sequences,
  • In a choice, no repeated element nor optionnal element.

Languages available

  • A set of tokens is available for the languages: bnf, json, lua python and hamill.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weyland-0.0.8.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

weyland-0.0.8-py3-none-any.whl (13.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page