At 1/24/2007 01:13 PM, Beauford wrote:
> Here is my rendition of what I think you are looking for.
>
> $str = 'tab(  )/space( )/[EMAIL PROTECTED]&*();:...';
>
> if ( preg_match('|[EMAIL PROTECTED]&*();:_.\\\\ /\t-]+$|', $str) ) {
>       echo 'success';
> } else {
>       echo 'failure';
> }
>

Here is the problem, and it is strange. If I enter each of the above
characters into my form one at a time and hit submit after each one, NO
error is produced for any of them.

If I cut and past this all at once:  [EMAIL PROTECTED]&*();:_.\ then an error
IS returned.

Are you really including a backslash as your final character? Are you escaping it? Is the error you're getting the result of the sequence \" or \' which eats up your ending delimiter?

Beauford, all of this stuff you're trying to do is elementary regular expression work. The problems you're having are undoubtedly very easy to solve, but so far helping you has been guesswork because we haven't actually seen the scripts you're actually running. To help us help you get past this log jam, give us all the material we need to analyze your problem.

1) Specify exactly which error messages you're getting.
2) Give us an URL to a test page that displays the strings and patterns and the error messages that result. 3) Copy the PHP script in step 2) with a .txt file extension and post that as well so we can proofread your code.

My own personal experience is that if you document and demonstrate your problem well enough that someone else can actually help you, the chances are that doing so will reveal the solution to you, like magic.

Regards,

Paul
__________________________

Juniper Webcraft Ltd.
http://juniperwebcraft.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to