improve regexp for inout fields