Forum Discussion

GZRService_Acco's avatar
GZRService_Acco
Qrew Member
24 days ago
Solved

Removing Invalid Characters for File Name

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 thro...
  • MarkShnier__You's avatar
    24 days ago

    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:

     

    \ / : * ? " < > |