Seeking a solution to replace certain ID numbers in my system with clickable numbers that open the related record. The challenge arises when the IDs are in the format of 123.456.789, as my regex also matches IP addresses like 123.[123.123.123] (where the [] indicates where it matches).
How can I prevent this unwanted behavior?
I attempted using the following regex:
/^(?!\.)([0-9]{3}\.[0-9]{3}\.[0-9]{3})(?!\.)/
I am specifically dealing with "notes" within a ticket system. When the note contains just the ID or an IP address, the regexp works fine. However, if the note includes additional text like:
Affected IDs:
641.298.855 (this, lead)
213.794.868
948.895.285
It fails to match the IDs correctly. Any assistance on resolving this issue and understanding what I might be doing wrong would be greatly appreciated.