spc476/LPeg-talk
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
The code examples used in a talk about LPeg. date1.lua Very basic LPeg code to validate a string as a date in a particular format. date2.lua A bit more complex example of LPeg that still validates a string as a date, but with more validation (hours are between 0 and 23, day of the month as a value between 1 and 31, etc). date3.lua Similar to date2.lua, but this time we actually capture the data and return a table similar to what os.date() will return. This shows how to capture data instead of just matching a string. strftime.lua A complex example where LPeg is used to parse a format string for strftime() and return a new LPeg expression that can be used to parse a date printed by that format string. This is about as simple an example of a DSL as you can get. test.lua A program to test strftime.lua. email-addr.lua Validate email addresses per the RFC-822 spec (including comments). Replaces one very large and infamous regex that claims to validate email address (but doesn't handle comments).
About
Code for a talk on LPeg
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published