View Single Post
  #7  
Old 10-17-2016, 02:56 AM
Zander Zander is offline
Registered User
 
Join Date: Oct 2016
Posts: 11
Hi Jake,

Thank you very much for that, I gave that script a shot but all it showed was [CRLF] after the text - I tried a lot of different removal lines/parameters to get the validation to accept the IP address copied from Excel with no luck

In the end I took a stab in the dark and removed the "$" from the end of the validation.
Old:
Code:
re.Pattern = "^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$"
New:
Code:
re.Pattern = "^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})"
This sort of works in terms of as long as there's an IP address at the start of the clipboard then it will allow the validation, however if there is anything else in the clipboard after the IP address it'll 'allow' that for example:
- 'Hello 1.1.1.1' is not allowed
- '1.1.1.1 Hello' is allowed

To combat this I'm doing a bit of investigation to add to the replace functions that I already have in place to remove any characters other than 0-9 and '.' - This should then hopefully fix my issue to get around the Excel issue!

I'll post an update on here once I've worked it out
Reply With Quote