libxml2
=>(a|b{0,3}){0,1} a aa b bb bbb bbbb ab ba =>([0-9]{0,3}|([0-9]{0}|[0-9]{0,3})){0,3} 0 00 123 abc