Regex:
\\*.*?(.502).*?.(LISTENING|ESTABLISHED)
502-> for tcp port
LISTENING|ESTALISHED-> for the network connection type check, | (pipe) is for or operation in regex, which means either of the presence is valid.
*?-> for non greedy regex accepting any character.
In order to locate industrial control devices utilizing the Modbus communications protocol, create a REGULAR EXPRESSION...