Home › Forums › Quform WordPress › Question: Regular Expression Filter – How to forbid a specific input text
- This topic has 7 replies, 2 voices, and was last updated 11 years, 5 months ago by MikeySmith.
- AuthorPosts
- June 4, 2013 at 6:57 am #4670MikeySmithParticipant
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
MikeyJune 4, 2013 at 10:20 am #4675AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 4, 2013 at 12:31 pm #4677MikeySmithParticipantHi 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
June 5, 2013 at 10:29 am #4687AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 5, 2013 at 2:04 pm #4695MikeySmithParticipantHi 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 regexThe 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?
June 5, 2013 at 5:49 pm #4703AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 18, 2013 at 6:36 am #4883MikeySmithParticipantHi 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
MikeyJune 18, 2013 at 6:40 am #4884MikeySmithParticipantHi Ally, Hi guy,s
I just answered the previous question to myself:
\s
is the regex-code for a whitespace (=blank). 🙂 - AuthorPosts
- You must be logged in to reply to this topic.