problems with type of children and regex in wrong order