Code: Select all
$pattern = '#^[a-z\s\.\-\']+$#i'
Is my regex wrong, or is magic quotes the source of my woe?
Moderator: General Moderators
Code: Select all
$pattern = '#^[a-z\s\.\-\']+$#i'
Okay, but is there still a problem then? If so, can you post a string that is not matched while you think it should match?LonelyProgrammer wrote:$pattern = '#^[a-z\s\.\-\']+$#i'
I swore I type this regex in the first message. I did escape the '
I presume the "yes" is "yes there is still a problem". Since you didn't quote anyone, I am not sure about it. If this is correct, then again: please post the input that should be matched and the regex that is responsible for the "not matching" of that input string.LonelyProgrammer wrote:Yes, ' are not being accepted in the text field, and it is being displayed as \' in the input box.
Hi,prometheuzz wrote:I presume the "yes" is "yes there is still a problem". Since you didn't quote anyone, I am not sure about it. If this is correct, then again: please post the input that should be matched and the regex that is responsible for the "not matching" of that input string.LonelyProgrammer wrote:Yes, ' are not being accepted in the text field, and it is being displayed as \' in the input box.