Skip to content

Instantly share code, notes, and snippets.

@zaininnari
Created July 25, 2010 12:06
Show Gist options
  • Save zaininnari/489518 to your computer and use it in GitHub Desktop.
Save zaininnari/489518 to your computer and use it in GitHub Desktop.
<?php
/*
'a',
'\61'
'\0061 '
'\000061',
'\000061 ',
*/
$defCharA = PEG::choice(
PEG::char('aA'),
PEG::seq(
'\\',
PEG::optional('0'),
PEG::optional('0'),
PEG::optional('0'),
PEG::optional('0'),
PEG::choice('41', '61'),
PEG::optional(PEG::char(" \t\r\n\f"))
)
);
/*
'g',
'\g',
'\67'
'\0067 '
'\000067',
'\000067 ',
*/
$defCharG = PEG::choice(
PEG::seq(PEG::optional('\\'), PEG::char('gG')),
PEG::seq(
'\\',
PEG::optional('0'),
PEG::optional('0'),
PEG::optional('0'),
PEG::optional('0'),
PEG::choice('47', '67'),
PEG::optional(PEG::char(" \t\r\n\f"))
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment