View Single Post
Old 10-13-2016, 09:47 AM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 1,099
Originally Posted by Zander View Post
...if I copy a cell from Excel with an IP address inside and then run this script in SecureCRT it doesn't recognise it as an IP address whereas if I copy the IP address from within the cell the validation is happy with this - ...when the Excel cell itself is copied something else is in the clipboard along with the IP address to cause the validation to believe it's not following the IP address conventions
There could be something wrong with the regular expression -- I'm not perfect at that (yet )... but I'm betting that there is something being copied by Excel into the clipboard when what's copied is the the cell rather than the text within it.

One way to "see" what's in would be to convert all non-printing characters in the clipboard to something that is visible (like [CR] for a carriage return, for example) and then throw that into a messagebox so you can see what special characters there are.

See the Reveal Non-Printing Characters example script found on our Script Examples "sticky" for specifics on how you can troubleshoot further.

Once you "see" the extra stuff that's being put into the clipboard by Excel when you copy a cell, you can add more Replace() calls to remove those special characters from the string the pattern will operate over.

Jake Devenport
VanDyke Software
Technical Support
YouTube Channel:
Reply With Quote