Skip to content

Instantly share code, notes, and snippets.

@derdewey
Created November 9, 2010 00:48
Show Gist options
  • Save derdewey/668540 to your computer and use it in GitHub Desktop.
Save derdewey/668540 to your computer and use it in GitHub Desktop.
Parse debian Packages.gz
grammar Debian
rule collection
entry+
end
rule entry
(tag space value)
end
rule package_details
tag value &[^$]
end
rule tag
[A-Za-z0-9\-]+ ":"
end
rule value
(!tag value_line+ "\n")+
end
rule value_line
([A-Za-z0-9 <>@()=\.\-|/,_"':])+
end
rule space
[ \t]+
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment