optiopay / klar

Integration of Clair and Docker Registry
MIT License
505 stars 138 forks source link

WIP: - Parse Host, Port, Image and Tag with regular expressions #64

Open bougar opened 6 years ago

hashmap commented 6 years ago

the first version used regexs, we switched to custom parsing later on https://github.com/optiopay/klar/commit/876ecd82b78e70f79df20a3c87fe5be765e1577a

bougar commented 6 years ago

What's the point in using custom implementation instead regex? :D Sorry by the inconveniencies, I did not see that commit. Anyway, I mind regex like: ImageRegexp = match((?:[/])(?P<name>[a-zA-Z0-9/]*)[:@]?(?P<tag>.*)?)

hashmap commented 6 years ago

One pass instead of multiple matches as it was before, you approach looks interesting