Skip to content

spc476/LPeg-talk

master
Switch branches/tags

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

Latest commit

 

Git stats

Files

Permalink
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

No packages published

Languages