I am writing an application in C# that will need to find placeholders in URLs and/or filenames, and substitute in a value, much like this: C:\files\file{number} => C:\files\file1 Unfortunately for that example, curly braces are allowed in file names and URLs.
Can anyone please suggest some characters that I can use to denote placeholders in files and URLs? Thank you!
Windows rather helpfully tells you what characters aren’t allowed in a filename, when you try to use on of them:
See this support article for more information, including the list of allowed characters.
^ Accent circumflex (caret) & Ampersand ' Apostrophe (single quotation mark) @ At sign { Brace left } Brace right [ Bracket opening ] Bracket closing , Comma $ Dollar sign = Equal sign ! Exclamation point - Hyphen # Number sign ( Parenthesis opening ) Parenthesis closing % Percent . Period + Plus ~ Tilde _ UnderscoreAs for URLs, see section 2.2 of RFC 1738 for a description of allowed characters:
…also of interest, from the same section:
It looks like the double-quote and angle bracket characters (
"<>) are good options.