Getting a / to work in regex RRS feed

  • Question

  • User-1767698477 posted

    I have a textbox field and I'd like to allow a / in the textbox. I have tried this both with and without a \ backslash character, and it's not working for me.

    <asp:TextBox ID="Txtotherloantype" runat="server" Width="175"></asp:TextBox>
    <asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator15" ControlToValidate="txtotherloantype"
    ValidationExpression="^[a-zA-Z0-9'\/@&#.\s]{7,10}$" ErrorMessage="Invalid Characters"
    Display="Dynamic" ForeColor="Red" Font-Bold="True"></asp:RegularExpressionValidator>

    What is the secret to getting this to work? Also, is a / character a risky character?

    Thursday, June 25, 2020 2:48 AM


  • User-1767698477 posted

    I wasn't entering enough characters! I had it minimum 7. It is working

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 25, 2020 2:52 AM