Skip to main content
Solved

Removing Invalid Characters for File Name

  • July 18, 2025
  • 0 replies
  • 208 views

Forum|alt.badge.img+4

Good Afternoon,

I am trying to manipulate a simple text field to remove the following characters:

\ / : * ? " < > |

So that I can use it for file names.

When I try SearchandReplace, it keeps throwing up syntax errors for these characters despite my double quotes around them.  Is there a way to get these characters removed to prevent any file upload issues due to file name?

Thank you for the help!

Best answer by MarkShnierYou

Here is Chat GPT's second response to your question.  I have not tested it myelf so please post back and let us know if it worked OK.

 

Yes, you can use RegexReplace() in Quickbase for a cleaner and more efficient solution than nesting multiple Substitute() calls.

βœ… Formula using

RegexReplace()

 

If your field is [Original Text], here’s the expression:

RegexReplace([Original Text], "[\\\\/:*?\"<>|]", "")

πŸ’‘ Explanation:

  • RegexReplace(text, pattern, replacement) replaces all matches of the regular expression pattern in the text with the replacement.
  • The regex pattern [\\\\/:*?\"<>|] matches any one of the listed characters.
  • The double backslash \\\\ is needed because:
    • In regex, \ is an escape character.
    • In Quickbase strings, you must escape backslashes again β€” so you need four (\\\\) to represent one literal \.

 

Characters being removed:

 

\ / : * ? " < > |

 

 

 

MarkShnierYou
Forum|alt.badge.img+24

Here is Chat GPT's second response to your question.  I have not tested it myelf so please post back and let us know if it worked OK.

 

Yes, you can use RegexReplace() in Quickbase for a cleaner and more efficient solution than nesting multiple Substitute() calls.

βœ… Formula using

RegexReplace()

 

If your field is [Original Text], here’s the expression:

RegexReplace([Original Text], "[\\\\/:*?\"<>|]", "")

πŸ’‘ Explanation:

  • RegexReplace(text, pattern, replacement) replaces all matches of the regular expression pattern in the text with the replacement.
  • The regex pattern [\\\\/:*?\"<>|] matches any one of the listed characters.
  • The double backslash \\\\ is needed because:
    • In regex, \ is an escape character.
    • In Quickbase strings, you must escape backslashes again β€” so you need four (\\\\) to represent one literal \.

 

Characters being removed:

 

\ / : * ? " < > |

 

 

 


Forum|alt.badge.img+4

Thank you so much.  This worked beautifully.