code: def isstrallowed(s,form):
      
      import re
      match = re.match(form,s)
      return match is not None
docs: Checks is input string conforms to input regex (`form`).
  
      :param s: input string.
      :param form: eg. for hdf5: `"^[a-zA-Z_][a-zA-Z0-9_]*$"`