Skip to content
/ groker Public

Erlang implementation of grok pattern matching

License

Notifications You must be signed in to change notification settings

altworx/groker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

groker

Erlang implementation of grok pattern matching. Heavily inspired by pygrok (https://github.com/garyelephant/pygrok).

Sample Usage

Now all the functionality is in the sigle module:

$ erl
c(groker).
Pattern = "%{WORD:name} is %{WORD:gender}, %{NUMBER:age:int} years old and weighs %{NUMBER:weight:float} kilograms".
Text = "gary is male, 25 years old and weighs 68.5 kilograms".
RE = groker:init(Pattern).
{ok, CRE} = re:compile(RE).
re:run(Text, CRE, [global, {capture, all, list}]).
{match,[["gary is male, 25 years old and weighs 68.5 kilograms",
         "gary","male","25","25","68.5","68.5"]]}

I'll pack it into OTP app next time.

About

Erlang implementation of grok pattern matching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages