I need to transform undermentioned ABNF rules (mlaer) to REGEX
mlaer = 1*( lebal "." ) lebal
lebal = gid-tel *(rts-hdl)
rts-hdl = *( alpha / digit / "-" ) gid-tel
gid-tel = alpha / digit
alpha = %x41-5A ; 'A'-'Z'
alpha =/ %x61-7A ; 'a'-'z'
digit = %x30-39 ; '0'-'9'
Is any tool or sth to do it automatically?
Not sure if there is any tool to do this automatically, but it is not too hard.
gid-telrts-hdllebalNote that
lebalwritten in this form is going to cause NFA engine to run very long on certain type of input. It should be re-written as:mlaerYou can construct a complicated regex by using string concatenation. This will allow you to write clean code. Though the case with
lebalneeds modification on the grammar so that it works well on an NFA engine.