package Ġcom . github . le om ill on . uuid generator . parser Ċ Ċ const Ġval ĠC UID _ LENGTH Ġ= Ġ 2 5 Ċ Ċ private Ġval ĠC UID _ REGEX Ġ= Ġ""" [ c C ][ a - zA - Z 0 - 9 ]{ 2 4 } """. to Regex () Ċ private Ġval ĠF IND _ C UID _ REGEX Ġ= Ġ""" (? < ![ 0 - 9 a - zA - Z ]) ($ C UID _ REGEX )( ?! ([ 0 - 9 a - zA - Z ] |\ ()) """. to Regex () Ċ Ċ class ĠC UID Parser ( ĊĠĠĠ Ġprivate Ġval Ġsource : ĠString Ċ ) Ġ{ ĊĊĠĠĠ Ġfun ĠisValid (): ĠBoolean Ġ= Ġsource . length Ġ== ĠC UID _ LENGTH Ġ&& ĠC UID _ REGEX . match Ent ire ( source ) Ġ!= Ġnull Ċ } Ċ Ċ fun ĠCharSequence . find C UID s () Ġ= ĠF IND _ C UID _ REGEX . findAll ( this ) ĊĠĠĠ Ġ. filter Ġ{ ĠC UID Parser ( it . value ). isValid () Ġ} ĊĠĠĠ Ġ. filter Ġ{ Ġit . value . contains At Least 2 Numbers () Ġ} ĊĠĠĠ Ġ. map Ġ{ Ġit . value Ġto Ġit . range Ġ} Ċ