katef / libfsm

DFA regular expression library & friends
BSD 2-Clause "Simplified" License
931 stars 52 forks source link

Add `fsm_generate_matches` to cli #419

Closed silentbicycle closed 1 year ago

silentbicycle commented 1 year ago

This adds a -G <max_length> option to re and fsm.

Also, add a default / basic use case callback, fsm_generate_cb_printf, which is what re and fsm use.

silentbicycle commented 1 year ago

CI failed because of https://github.com/katef/kmkf/issues/14 , rerunning.

silentbicycle commented 1 year ago

CI failed again, because of katef/kmkf#14 , rerunning again.

katef commented 1 year ago

Sample output:

; ./build/bin/re -r pcre -G 5 '^a[0-9]*b?c'
abc
abc!
abc!!
ac
ac!
ac!!
ac!!!
a0bc
a0bc!
a0c
a0c!
a0c!!
a00c
a00c!