Hi
As I said before I don't use posix regexes (i.e. ereg), as they're not
binary safe and can be much slower than the PCRE versions. the PCRE
equivalent of what you want is:
if (preg_match("/^[-A-Za-z0-9_' ]+$/", $string)}:
echo "string valid";
else:
echo "string invalid";
endif;
The "A-
Then I think this will do the trick for you :)
$string = "~YOUR STRING~"
if (!eregi_replace("[0-9A-Za-z -_']","",$string))
{
echo "string allowed";
}
else {
echo "string disallowed";
}
--
No, this is what I said in my original email.
I want to allow the following: a to z, A to Z, 0 to 9, and "_-'" (without
the double quotes) and spaces.
I don't care about length, I don't care about order. I just want the user to
be able to use these characters. A to z A to Z 0 to 9 and the charac
There's thousands of things you can access via COM. Windows uses it
extensively. Every application in Microsoft Office uses COM. I've used COM
between Excel and MapPoint to generate maps (and yeah, I created a PHP script
to access MapPoint directly.. but it was just easier to do it via Excel)
I think this is your solution:
$string = "~YOUR STRING~"
if (!eregi_replace("[0-9A-Za-z -_']","",$string))
{
echo "string allowed";
}
else {
echo "string disallowed";
}
-
Hi
What you've written doesn't match the description you gave. As a
regular expression "([0-9][A-Z][a-z][-_.'\ ])" means a digit followed by
an uppercase letter followed by a lower case letter followed by (hyphen
or underscore or mid-dot or single quote or space). This is a total of
four charact
Nope, doesn't work for me. I think what I'm trying to do must not be
possible. I've been at this for two days now. I changed yours to this - ereg
("([0-9][A-Z][a-z][-_.'\ ])" but it always says that it is invalid. The
last one after the slash is supposed to be a space - I have to have a space.
I d
Oops that should be "^[\w'-]+$"
Niel
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi
> I want to allow the following: a to z, A to Z, 0 to 9, and "_-'" (without
> the double quotes) and spaces. I have now been screwing around with this for
> over 8 hours. There are other issues as well that has been compoudning this,
> but this would be a great start to solving my issue.
I don
- Original Message -
From: "gunawan" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, January 16, 2007 11:57 AM
Subject: COM surgery
> i read the com and interested using in my program..
> but the help (php manual chm) don't give what i need
> example :
> $word = new COM("word.application") or di
10 matches
Mail list logo