add nameregexp constrain

Add nameregexp constrain to member and static method