Has anyone already developed a regular expression to find invalid chars in a windows filename?
REFind("[\\/:\*\?""<>\|]",fileName)
Probably also a good idea to check for non-ASCII characters. Use of these won't make the filename invalid for windows but I always go for the lowest common denominator to keep things system independent as much as possible. In this case, it's printable 7-bit US-ASCII characters.
REFind("[\\/:\*\?""<>\|]",fileName) OR REFind("[^#chr(32)#-#chr(126)#]",fileName)
You could wrap the two of these into one regex if you want, though it kinda makes sense to keep them separate to make it clear that one checks for valid windows filenames and the other is just to satisfy programmer paranoia. BTW, CF's implementation of the POSIX print character class seems to include ALL printable characters, not just those in the 7-bit US-ASCII range, ie. chr(32) - chr(126) inclusive.
Mark
--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
