DEVSutils.py 244 B

123456789101112
  1. import re
  2. def get_general_port(text):
  3. # Get the general name of a private port with regex
  4. match = re.search(r'private_\d+_(\w+)', text)
  5. if match:
  6. result = match.group(1)
  7. return result
  8. else:
  9. return text