On Wed, 2 Jun 2010 12:14:47 -0400
Alice Wei wrote:
>
> Hi,
>
> I have a code snippet here as in the following:
>
> [CODE]
> $keywords = preg_split("/[\s,]+/", $day);
> $count = count($keywords);
> if(preg_match("(Mon|Tue|Wed|Thu|Fri)/i", $keywords[$i])) { //line 40
>$day_query ="start_t
> From: peter.e.l...@gmail.com
> Date: Wed, 2 Jun 2010 18:17:00 +0200
> Subject: Re: [PHP] Preg Match Problem
> To: aj...@alumni.iu.edu
> CC: php-general@lists.php.net
>
> On 2 June 2010 18:14, Alice Wei wrote:
> >
> > Hi,
> >
> > I have a code sn
On 2 June 2010 18:14, Alice Wei wrote:
>
> Hi,
>
> I have a code snippet here as in the following:
>
> [CODE]
> $keywords = preg_split("/[\s,]+/", $day);
> $count = count($keywords);
> if(preg_match("(Mon|Tue|Wed|Thu|Fri)/i", $keywords[$i])) { //line 40
You're lacking the starting delimiter '/'
Hi,
I have a code snippet here as in the following:
[CODE]
$keywords = preg_split("/[\s,]+/", $day);
$count = count($keywords);
if(preg_match("(Mon|Tue|Wed|Thu|Fri)/i", $keywords[$i])) { //line 40
$day_query ="start_time.day='12345' AND end_time.day='12345'";
}
if(preg_match("Sat
I'm not sure what you're trying to do with preg_match, since the
parameters you send to it, are from the database, and an undeclared
variable $msg(which is what exactly). Unless you give us examples of
the arguments to preg_match, and what you expect the results should
be, as well as what they are
This php script perform matching text of some certain URLs. but in this
preg_match it wont match few patterns < _ .
with help of this script , can some body help me to match the other all
patterns .plz ?
";
if ( preg_match("/$chk_msg/", "$msg", $match) ) {
* Thus wrote Marek Kilimajer ([EMAIL PROTECTED]):
> Do you realy want to use [ and ] as patern delimiters? My quess is that
> you want to use it for defining character class. Then the only character
> that must be escaped is -
>
> '/[^a-z0-9,._+()\-]/i'
actually, you don't even need that escape
Do you realy want to use [ and ] as patern delimiters? My quess is that
you want to use it for defining character class. Then the only character
that must be escaped is -
'/[^a-z0-9,._+()\-]/i'
Luis Lebron wrote:
I found a reqular expresion that I'm using to check for valid characters in
file n
* Thus wrote Luis Lebron ([EMAIL PROTECTED]):
> I found a reqular expresion that I'm using to check for valid characters in
> file names.
>
> Here's the sample code:
>
> if(preg_match("[^a-zA-Z0-9,._\+\()\-]",$filename))
> {
> //blah, blah, blah
> }
preg_* need a pattern deliminater (most
I found a reqular expresion that I'm using to check for valid characters in
file names.
Here's the sample code:
if(preg_match("[^a-zA-Z0-9,._\+\()\-]",$filename))
{
//blah, blah, blah
}
However, when I run the script I get the following error:
Warning: Compilation failed: unmatched paren
I am passing a string and making sure all the characters in that string
are valid.
Example:
For a persons age I am using:
if (!preg_match("/^[0-9]+$/", $Age)) echo "Please Enter numeric value
for age".
But how would I include the following characters as permissible in preg
match
~!@#$%^&*()
I am passing a string and making sure all the characters in that string
are valid.
Example:
For a persons age I am using:
if (!preg_match("/^[0-9]+$/", $Age)) echo "Enter numeric value for age".
But how would I include the following characters as permissible in preg
match
~!@#$%^&*()-=_+,.?
12 matches
Mail list logo