Converts pid to a string for the regex comparison.