Question: Regular Expression Filter – How to forbid a specific input text

Home Forums Quform WordPress Question: Regular Expression Filter – How to forbid a specific input text

This topic is: resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #4670
    MikeySmith
    Participant

    Hi guys, I have a question for the regular expression experts:

    Within a textarea input: How do I prevent a user from submitting a specific text?? I guess the only way to do this is the regular expression filter.

    This here does not work

    ^(?!Hi guys, this is the prefilled text. The user has not changed it.$)

    Any ideas? I would be really thankful for a tip

    Kind regards
    Mikey

    #4675
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #4677
    MikeySmith
    Participant

    Hi Ally,

    thanks for the hint.

    What do I have to do to make it work with in the text?

    So that it would filter a text like this:

    Hi guys,
    this is the prefilled text.

    The user has not changed it

    #4687
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #4695
    MikeySmith
    Participant

    Hi Ally,

    for some reason I can’t get this to work.

    My settings:
    1) Multi-line textbox with the exact text from above
    3) Validation “Regex” Filter with your latest regex

    The problem:
    The filter does not trigger at all… there is no error message shown. Not if I leave the default text and not if I enter a different text..

    Any ideas? Can you reproduce this?

    #4703
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #4883
    MikeySmith
    Participant

    Hi Ally,

    yes, you are right: the problem where the blanks!

    The problem is that I’d actually like to have a blank at the end of a line.

    How do I make the regex aware of a blank (at the end of a line)?
    Is there a special regex-character for it?

    Kind regards
    Mikey

    #4884
    MikeySmith
    Participant

    Hi Ally, Hi guy,s

    I just answered the previous question to myself:

    \s is the regex-code for a whitespace (=blank). 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy