On 3 December 2010 11:13, Da Rock wrote:
> On 12/03/10 16:33, Tamara Temple wrote:
>>
>> On Dec 2, 2010, at 11:33 PM, Da Rock wrote:
>>
>>> On 11/29/10 09:10, Richard Quadling wrote:
On 27 November 2010 04:45, Da Rock
wrote:
> On 11/27/10 13:51, Tamara Temple wrote:
>
On 3 December 2010 11:13, Da Rock wrote:
> On 12/03/10 16:33, Tamara Temple wrote:
>>
>> On Dec 2, 2010, at 11:33 PM, Da Rock wrote:
>>
>>> On 11/29/10 09:10, Richard Quadling wrote:
On 27 November 2010 04:45, Da Rock
wrote:
> On 11/27/10 13:51, Tamara Temple wrote:
>
On 12/03/10 16:33, Tamara Temple wrote:
On Dec 2, 2010, at 11:33 PM, Da Rock wrote:
On 11/29/10 09:10, Richard Quadling wrote:
On 27 November 2010 04:45, Da
Rock wrote:
On 11/27/10 13:51, Tamara Temple wrote:
On Nov 26, 2010, at 7:28 PM, Da Rock wrote:
On 11/27/10 00:57, Richard Quad
On Dec 2, 2010, at 11:33 PM, Da Rock wrote:
On 11/29/10 09:10, Richard Quadling wrote:
On 27 November 2010 04:45, Da Rockl...@herveybayaustralia.com.au> wrote:
On 11/27/10 13:51, Tamara Temple wrote:
On Nov 26, 2010, at 7:28 PM, Da Rock wrote:
On 11/27/10 00:57, Richard Quadling wrote:
On 11/29/10 09:10, Richard Quadling wrote:
On 27 November 2010 04:45, Da Rock wrote:
On 11/27/10 13:51, Tamara Temple wrote:
On Nov 26, 2010, at 7:28 PM, Da Rock wrote:
On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da Rock
wrote:
On 27 November 2010 04:45, Da Rock wrote:
> On 11/27/10 13:51, Tamara Temple wrote:
>>
>> On Nov 26, 2010, at 7:28 PM, Da Rock wrote:
>>
>>> On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da Rock
wrote:
> preg_match("/(\d{1,3})(\.)$/", exec($mixer .
On 11/27/10 13:51, Tamara Temple wrote:
On Nov 26, 2010, at 7:28 PM, Da Rock wrote:
On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da
Rock wrote:
preg_match("/(\d{1,3})(\.)$/", exec($mixer . ' ' .
$command),&$matches)
Can you ...
var_dump(exec($mixer . ' ' . $co
On Nov 26, 2010, at 7:28 PM, Da Rock wrote:
On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da Rockl...@herveybayaustralia.com.au> wrote:
preg_match("/(\d{1,3})(\.)$/", exec($mixer . ' ' . $command),&
$matches)
Can you ...
var_dump(exec($mixer . ' ' . $command));
On 11/27/10 00:57, Richard Quadling wrote:
On 26 November 2010 00:07, Da Rock wrote:
preg_match("/(\d{1,3})(\.)$/", exec($mixer . ' ' . $command),&$matches)
Can you ...
var_dump(exec($mixer . ' ' . $command));
I wonder if the output includes a new line which you are not
accounting
On Nov 25, 2010, at 6:07 PM, Da Rock wrote:
preg_match("/(\d{1,3})(\.)$/", exec($mixer . ' ' . $command), &
$matches)
it looks like you're failing to account for the newline that comes
back in a command execution. Add trim() around the exec() call and try
again.
--
PHP General Mailing Li
On 26 November 2010 00:07, Da Rock wrote:
> preg_match("/(\d{1,3})(\.)$/", exec($mixer . ' ' . $command), &$matches)
Can you ...
var_dump(exec($mixer . ' ' . $command));
I wonder if the output includes a new line which you are not
accounting for in the regex.
--
Richard Quadling
Twitter : EE
Jim Lucas wrote:
> Ashley M. Kirchner wrote:
>> I have an array that's created as follows:
>>
>>
>>
>> $string = "73G146C 311- 309.1C";
>>
>>
>> Anyone want to take a stab at it?
>>
>>
>
> Conditionals are your friend!
>
>
> $string = "73G146C 311- 309.1C";
>
> $arr = pre
Ashley M. Kirchner wrote:
> I have an array that's created as follows:
>
>
>
> $string = "73G146C 311- 309.1C";
>
> $arr = preg_split("/[\s]+/", $string);
>
>
>
> Now I need to take each element in that array, and break them up even
> further so that I get:
>
>
>
> 73G=>
Thanks! Thats about what I'm doing right now.
function parse_prim_states($in)
{
preg_match('@prim_states[\s]*\((?[0-9\s]*)@' ,$in ,
$matches);
$this->num_prim_states = (int)$matches['number'];
preg_match_all('@prim_state[\s]*\((?[a-fA-F0-
trying to avoid. But maybe that's
what I have to after all if there is no other way.
Thanks & Regards,
Jan
-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Wednesday, September 09, 2009 6:21 PM
To: Jan Reiter
Cc: php-general@lists.php.net
Subject: R
On Wed, 2009-09-09 at 18:18 +0200, Jan Reiter wrote:
> Good Afternoon.
>
>
>
> This shouldn't be too complicated, but I can't come up with a solution for
> the problem right now. It's about RegEx in PHP (5.2)
>
>
>
> Is there a way to capture ALL sub elements of an expression like
> preg_ma
> -Original Message-
> From: b [mailto:p...@logi.ca]
> Sent: 30 July 2009 03:17
>
>
> >
> >>> echo (preg_match($pattern, $test) != false)
> >
> > The " != false " here is redundant.
>
> Understood. But what you think is redundancy is, to me, clarity in
> programming. I happen to think th
Ben Dunlap wrote:
> have -- "($x != false)" -- will be true whether $x is 0, NULL, an empty
> string,
[8<]
> But "$x !== false" will only be true in the last case.
Sorry, replace "be true" with "be false" above.
-Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
echo (preg_match($pattern, $test) != false)
>>
>> The " != false " here is redundant.
>
> Understood. But what you think is redundancy is, to me, clarity in
> programming. I happen to think that boolean tests shouldn't ride on
> whether or not an array returned from a function is empty or not
On 07/29/2009 11:18 PM, Daniel Kolbo wrote:
b wrote:
On 07/29/2009 07:48 PM, Daniel Kolbo wrote:
code works (no match) for me too on php 5.2.6 build date May 2 2008
18:01:20 with dumbdows NT.
preg_match fails but for a reason other than what I think you may be
expecting. It fails b/c of the f
b wrote:
> On 07/29/2009 07:48 PM, Daniel Kolbo wrote:
>>
>> code works (no match) for me too on php 5.2.6 build date May 2 2008
>> 18:01:20 with dumbdows NT.
>>
>> preg_match fails but for a reason other than what I think you may be
>> expecting. It fails b/c of the first forwards slash in $url.
On 07/29/2009 07:48 PM, Daniel Kolbo wrote:
code works (no match) for me too on php 5.2.6 build date May 2 2008
18:01:20 with dumbdows NT.
preg_match fails but for a reason other than what I think you may be
expecting. It fails b/c of the first forwards slash in $url. The regex
engine doesn't
On 07/29/2009 03:03 PM, Ben Dunlap wrote:
Jim Lucas wrote:
I expected 'no match' but get 'match'.
[8<]
cut/paste your code and it works for me.
Works for me as well. I get 'no match' from PHP 5.1.2, 5.2.6, and 5.2.8. What
version do you have?
5.2.9
If I might suggest a couple of simplifi
On 07/29/2009 02:07 PM, Jim Lucas wrote:
b wrote:
I'm trying to figure out how to test if a string matches *exactly*
another string, using a regexp pattern. The manual says that ereg() is
deprecated (in favour of what?) and preg_match() is giving me trouble.
The problem is that I'm passing the e
Jim Lucas wrote:
> Ben Dunlap wrote:
>> Jim Lucas wrote:
I expected 'no match' but get 'match'.
>> [8<]
>>> cut/paste your code and it works for me.
>> Works for me as well. I get 'no match' from PHP 5.1.2, 5.2.6, and 5.2.8. What
>> version do you have?
>
> PHP 5.2.5 with Suhosin-Patch 0.9.6.
Ben Dunlap wrote:
> Jim Lucas wrote:
>>> I expected 'no match' but get 'match'.
> [8<]
>> cut/paste your code and it works for me.
>
> Works for me as well. I get 'no match' from PHP 5.1.2, 5.2.6, and 5.2.8. What
> version do you have?
PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Mar 11 200
Jim Lucas wrote:
>> I expected 'no match' but get 'match'.
[8<]
> cut/paste your code and it works for me.
Works for me as well. I get 'no match' from PHP 5.1.2, 5.2.6, and 5.2.8. What
version do you have?
If I might suggest a couple of simplifications that would make it easier to
follow/troubles
b wrote:
> I'm trying to figure out how to test if a string matches *exactly*
> another string, using a regexp pattern. The manual says that ereg() is
> deprecated (in favour of what?) and preg_match() is giving me trouble.
> The problem is that I'm passing the end-of-line delimiter ($) but it
> se
tedd wrote:
At 4:18 PM +0200 4/9/09, Merlin Morgenstern wrote:
Hello,
I am trying to extract a number out of a string that is in utf-8 and
contains chines characters.
This unfortunatelly does not work:
preg_match('{(\d+)}', $details, $m);
$number = $m[1];
I also tried to
At 4:18 PM +0200 4/9/09, Merlin Morgenstern wrote:
Hello,
I am trying to extract a number out of a string that is in utf-8 and
contains chines characters.
This unfortunatelly does not work:
preg_match('{(\d+)}', $details, $m);
$number = $m[1];
I also tried to
Per Jessen wrote:
Michael A. Peters wrote:
What I'm trying to do is write a preg matches for each case I come
across - if it matches the preg, it then parses according to the
pattern to get me an acceptable -MM-DD (not sure how I'll deal
with the season case yet ... but I'm serious, that ki
Michael A. Peters wrote:
This is what I have so far -
$pattern[] = "/^([0-9]{1,2})[\s-]([A-Z][a-z]*)[\s-]([0-9]{4,4})$/i";
$clean[] = "\\3-\\2-\\1";
$pattern[] = "/^([A-Z][a-z]*)[\s-]([0-9]{4,4})$/";
$clean[] = "\\2-\\1-01";
$foo = preg_replace($pattern, $clean, $verb_date);
If I were yo
Michael A. Peters wrote:
> What I'm trying to do is write a preg matches for each case I come
> across - if it matches the preg, it then parses according to the
> pattern to get me an acceptable -MM-DD (not sure how I'll deal
> with the season case yet ... but I'm serious, that kind of thing i
bruce wrote:
> hi...
>
> trying to figure out the best approach to using preg_match to extract the
> number from the follwing type of line...
>
> " 131646 sometext follows.."
>
> basically, i want to extract the number, without the text, but i have to be
> able to match on the "text"
>
> i've b
preg_match('/^([0-9]+) (.)+/',$sString,$aMatches);
Matches will be 1 => the number ; 2 => the text. The expression only matches
if there is any character after the space. Not necessarily text, it might
be another number or special characters
2009/2/6 bruce
> hi...
>
> trying to figure out the
> -Original Message-
> From: Alex Chamberlain [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 27, 2008 10:09 AM
> To: PHP General list
> Subject: [PHP] preg_match
>
> Hi,
>
> I don't understand regular expressions at all - I will make an effort
> to
> learn about them one day, but I nee
Please keep the conversation on the list!
On 27 Oct 2008, at 16:06, Alex Chamberlain wrote:
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: 27 October 2008 15:54
To: Alex Chamberlain
Cc: 'PHP General list'
Subject: Re: [PHP] preg_match
On 27 Oct 2008, at 1
On Mon, Oct 27, 2008 at 11:54 AM, Stut <[EMAIL PROTECTED]> wrote:
> On 27 Oct 2008, at 15:46, Alex Chamberlain wrote:
>>
>> Problem solved:
>> function __autoload($c) {
>> $m = array();
>> preg_match('/(?:^[A-Z][a-z]+)Controller/', $c, $m);
>> if (count($m)) {
>> require_once(realpath(FS_CONTRO
On 27 Oct 2008, at 15:46, Alex Chamberlain wrote:
Problem solved:
function __autoload($c) {
$m = array();
preg_match('/(?:^[A-Z][a-z]+)Controller/', $c, $m);
if (count($m)) {
require_once(realpath(FS_CONTROLLER . '/' . strtolower($m[0]) .
'.inc.php'));
}
}
However (perhaps a more appropria
> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED]
> Sent: 27 October 2008 15:21
> To: Alex Chamberlain
> Cc: PHP General list
> Subject: Re: [PHP] preg_match
>
> On 27 Oct 2008, at 15:08, Alex Chamberlain wrote:
> > I don’t understand regular expre
On 27 Oct 2008, at 15:08, Alex Chamberlain wrote:
I don’t understand regular expressions at all – I will make an
effort to
learn about them one day, but I need a solution today. I want to use
the
__autoload function, but not for all my class only those that finish
in
‘Controller’. So for in
On Wed, May 30, 2007 5:04 pm, Jim Lucas wrote:
> btw: why is there a period in the second pattern? Also, why are you
> allowing for uppercase letters
> when the RFC's don't allow them?
LDAP URL domain can't be ALL CAPS?!
Last I heard, domain names were case-insensitive in every other URL...
--
On Wed, May 30, 2007 4:25 pm, Jared Farrish wrote:
> On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>>
>> If you can't find them documented, print them out:
>>
>> echo "PREG_NO_ERROR: '", PREG_NO_ERROR, '";
>>
>
> Doh!
>
> PREG_NO_ERROR: 0
> PREG_INTERNAL_ERROR: 1
> PREG_BACKTRACK_LIMIT_ERROR
On Thursday 31 May 2007 01:33, Jared Farrish wrote:
> Can anybody spot why this doesn't seem to be working right? The manual
> ( http://us2.php.net/preg_match) says it returns "false" on error, but
> preg_last_error() returns 0, which I assume points to the
> "PREG_NO_ERROR" error code.
>
>
> pre
Stut wrote:
Jared Farrish wrote:
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote:
>
> preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server)
You are missing the start/end delimiters is your first problem...
Which ones? I
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
If you can't find them documented, print them out:
echo "PREG_NO_ERROR: '", PREG_NO_ERROR, '";
Doh!
PREG_NO_ERROR: 0
PREG_INTERNAL_ERROR: 1
PREG_BACKTRACK_LIMIT_ERROR: 2
PREG_RECURSION_LIMIT_ERROR: 3
PREG_BAD_UTF8_ERROR: 4
So apparently,
On Wed, May 30, 2007 3:25 pm, Jared Farrish wrote:
> On 5/30/07, Stut <[EMAIL PROTECTED]> wrote:
>>
>> You need delimiters around the regex, as stated in the
>> documentation.
>>
>> preg_match("/^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/",$this->server)
>>
>> Although you don't need to use slashes
On 5/30/07, Stut <[EMAIL PROTECTED]> wrote:
You need delimiters around the regex, as stated in the documentation.
preg_match("/^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$/",$this->server)
Although you don't need to use slashes, you can use any character you
want but you must escape it in if it
On Wed, May 30, 2007 3:06 pm, Jared Farrish wrote:
> On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote:
>> >
>> > preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server)
>>
>> You are missing the start/end delimiters is your
Jared Farrish wrote:
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote:
>
> preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server)
You are missing the start/end delimiters is your first problem...
Which ones? I've got the s
On 5/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote:
>
> preg_match("^ldap(s)?://[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$this->server)
You are missing the start/end delimiters is your first problem...
Which ones? I've got the starter "^" and the clo
On Wed, May 30, 2007 12:33 pm, Jared Farrish wrote:
> Hi all,
>
> Can anybody spot why this doesn't seem to be working right? The manual
> (
> http://us2.php.net/preg_match) says it returns "false" on error, but
> preg_last_error() returns 0, which I assume points to the
> "PREG_NO_ERROR"
> error c
Myron Turner wrote:
James Lockie wrote:
I am trying to use this code to display a button at the root but it
always displays the button. :-(
if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
# display a button
You got the end-of-string character ($) in the wrong place:
i
James Lockie wrote:
I am trying to use this code to display a button at the root but it
always displays the button. :-(
if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
# display a button
You got the end-of-string character ($) in the wrong place:
if (! (preg_match( "/\
On Tue, February 6, 2007 7:46 pm, James Lockie wrote:
> I am trying to use this code to display a button at the root but it
> always displays the button. :-(
>
> if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
Without any "modifier", $ matches the END of the string.
It is impo
On Thu, January 25, 2007 9:53 am, Jim Lucas wrote:
> http://www.cmsws.com/examples/php/preg_match/example01.php
The \t inside of '' has no special meaning.
So you don't have a TAB character in there.
You need "" to get \t to mean TAB
Once you do that, you should then escape the $ with \$ instead
Beauford wrote:
Hi Jim,
Thanks for all the help, but where is the link.
Here is a link to a page that has this on it, but with the added "'"
Plus a link to the source code for it.
Jim
--
PHP General Mailing List (http://www.php.net/) To
unsubscribe, visit: http://www.php.net/unsub.php
Hi Jim,
Thanks for all the help, but where is the link.
> Here is a link to a page that has this on it, but with the added "'"
>
> Plus a link to the source code for it.
>
> Jim
>
> --
> PHP General Mailing List (http://www.php.net/) To
> unsubscribe, visit: http://www.php.net/unsub.php
>
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 str
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';
> }
>
H
> 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.
> You don't need to escape the apostrophe if the pattern isn't
> quoted with apostrophes in PHP or delimited by apostrophes in
> the PREG pattern. But generally there's no harm in escaping
> characters unnecessarily; it just makes for messier code.
>
> Here is a simple test of the regexp I rec
At 1/23/2007 09:50 AM, Beauford wrote:
> preg_match("/[EMAIL PROTECTED]&()*;:_.'\/ ]+$/", $string)
>
On top of this, every time a ' is entered it gets preceded by \. If I just
check for the characters like below that doesn't happen. Totally confused.
if(preg_match("/^[-A-Za-z0-9_.'
Beauford wrote:
You need to escape that forward slash in the character class:
preg_match("/[EMAIL PROTECTED]&()*;:_.'\/
Also, you've got only two backslashes in your char class. PHP is
reducing this to a single backslash before the space character. I
think you intend this to be t
if (preg_match('/[EMAIL PROTECTED]&()*;:_.'\\/ ]+$/', $string))
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 {
> You need to escape that forward slash in the character class:
>
> preg_match("/[EMAIL PROTECTED]&()*;:_.'\/
>
> Also, you've got only two backslashes in your char class. PHP is
> reducing this to a single backslash before the space character. I
> think you intend this to be two b
> if (preg_match('/[EMAIL PROTECTED]&()*;:_.'\\/ ]+$/', $string))
>
> Use single quotes and double back-slashes. PHP strings also
> have escape sequences that use the back-slash as escape
> character, that's why you have to double them. And single
> quotes to avoid the $ character interpr
At 1/23/2007 04:52 AM, Martin Alterisio wrote:
if (preg_match('/[EMAIL PROTECTED]&()*;:_.'\\/ ]+$/', $string))
Close but no cigar. Because you're using apostrophe to quote the
expression, PHP interprets the apostrophe inside the character class
as ending the quoted expressions and fails
# [EMAIL PROTECTED] / 2007-01-23 09:52:17 -0300:
> 2007/1/22, Beauford <[EMAIL PROTECTED]>:
> PS: Will we be risking going the perl way if we ask that PHP supported
> regular expressions natively (I mean: without having to provide them as
> strings)?
Yes. I don't know about other people's objecti
2007/1/22, Beauford <[EMAIL PROTECTED]>:
... much blah blah blah ...
I've probably read 100 pages on this, and no matter what I try it doesn't
work. Including all of what you suggested above - is my PHP possessed?
if(preg_match("/[EMAIL PROTECTED]&()*;:_.'/\\ ]+$/", $string)) { gives me
this
At 1/22/2007 04:56 PM, Beauford wrote:
I've probably read 100 pages on this, and no matter what I try it doesn't
work. Including all of what you suggested above - is my PHP possessed?
if(preg_match("/[EMAIL PROTECTED]&()*;:_.'/\\ ]+$/", $string)) { gives me
this error.
Warning: preg_match() [fu
> -Original Message-
> From: Paul Novitski [mailto:[EMAIL PROTECTED]
> Sent: January 22, 2007 6:58 PM
> To: PHP
> Subject: Re: [PHP] preg_match problem
>
> At 1/22/2007 03:04 PM, Beauford wrote:
> >I'm trying to get this but not quite there. I
At 1/22/2007 03:04 PM, Beauford wrote:
I'm trying to get this but not quite there. I want to allow the following
characters.
[EMAIL PROTECTED]&()*;:_.'/\ and a space.
Is there a special order these need to be in or escaped somehow. For
example, if I just allow _' the ' is fine, if I add the oth
2007/1/20, Arpad Ray <[EMAIL PROTECTED]>:
Martin Alterisio wrote:
> Double slash to prevent PHP interpreting the slashes. Also using single
> quotes would be a good idea:
>
> if (preg_match('/[\\w\\x2F]{6,}/',$a))
>
Just switching to single quotes would do the trick - you don't need to
escape a
Martin Alterisio wrote:
Double slash to prevent PHP interpreting the slashes. Also using single
quotes would be a good idea:
if (preg_match('/[\\w\\x2F]{6,}/',$a))
Just switching to single quotes would do the trick - you don't need to
escape anything but single quotes, and backslashes if the
Double slash to prevent PHP interpreting the slashes. Also using single
quotes would be a good idea:
if (preg_match('/[\\w\\x2F]{6,}/',$a))
2007/1/19, Németh Zoltán <[EMAIL PROTECTED]>:
Hi all,
I have a simple checking like
if (preg_match("/[\w\x2F]{6,}/",$a))
as I would like to allow all
Not a big regex expert, but first off i would recommend not using / as a
delimiter for your pattern if you are trying to catch forward slashes in
your text.
I would use a pattern like:
#[a-zA-Z0-9/]{6,}#
Regards,
Tim
> -Message d'origine-
> De : Németh Zoltán [mailto:[EMAIL PROTECTED]
On p, 2007-01-19 at 15:39 +, Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-19 15:25:38 +0100:
> > Hi all,
> >
> > I have a simple checking like
> >
> > if (preg_match("/[\w\x2F]{6,}/",$a))
> >
> > as I would like to allow all "word characters" as mentioned at
> > http://hu2.php.net/
# [EMAIL PROTECTED] / 2007-01-19 15:25:38 +0100:
> Hi all,
>
> I have a simple checking like
>
> if (preg_match("/[\w\x2F]{6,}/",$a))
>
> as I would like to allow all "word characters" as mentioned at
> http://hu2.php.net/manual/hu/reference.pcre.pattern.syntax.php
> plus the '/' character, and
On Dec 1, 2006, at 1:56 PM, Richard Lynch wrote:
On Thu, November 30, 2006 5:04 pm, Kevin Murphy wrote:
Well the problem would be then that the entire string would be lower
case, and I only can have the link as lower case. Is there a way to
apply strtolower into the preg_match?
Why not use lo
On Thu, November 30, 2006 5:04 pm, Kevin Murphy wrote:
> Well the problem would be then that the entire string would be lower
> case, and I only can have the link as lower case. Is there a way to
> apply strtolower into the preg_match?
Why not use lower(link) in SQL to get the link out in the firs
Well the problem would be then that the entire string would be lower
case, and I only can have the link as lower case. Is there a way to
apply strtolower into the preg_match?
--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3
Why not use strtolower on the string after the replacements have been made?
--
http://www.web-buddha.co.uk
On Mon, August 21, 2006 2:13 pm, Dave Goodchild wrote:
> On 21/08/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>
>> hi.
>>
>> I have to check if the script file belongs to any ov form1.php to
>> form6.php files. Need something like:
>> preg_match('/form*.php/', $_SERVER['PHP_SELF'])
>> whe
function doMatch($f) {
echo $f,
" = ",
(preg_match("#^form[1-6]\.php\$#",basename($f))?"true":"false"),
"\n";
}
doMatch("form1.php"); // true
doMatch("form2.php"); // true
doMatch("form3.php"); // true
doMatch("form4.php"); // true
doMatch("fo
Works perfect. Thanks!
;)
-afan
> function doMatch($f) {
> echo $f,
> " = ",
> (preg_match("#^form[1-6]\.php\$#",basename($f))?"true":"false"),
> "\n";
> }
>
> doMatch("form1.php"); // true
> doMatch("form2.php"); // true
> doMatch("form3.php"); // t
I think this pattern would also match form16.php etc, which I think is
not what afan wanted.
Dave Goodchild wrote:
On 21/08/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
hi.
I have to check if the script file belongs to any ov form1.php to
form6.php files. Need something like:
preg_match(
On 21/08/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
hi.
I have to check if the script file belongs to any ov form1.php to
form6.php files. Need something like:
preg_match('/form*.php/', $_SERVER['PHP_SELF'])
wher * kan be any number between 1 and 6.
Thanks for any help.
the pattern is f
On 10/08/06, Peter Lauri <[EMAIL PROTECTED]> wrote:
Hi there,
You are correct that I am stupid to call the manual bad, it was not meant
like that. It was that it was not suited to me, and that I actually just
wanted to find a solution to my problem directly, and it did not give me
that. I have
--Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 09, 2006 6:06 PM
To: Peter Lauri
Cc: php-general@lists.php.net
Subject: Re: [PHP] preg_match
Peter Lauri wrote:
> Hi,
>
>
>
> How do I add so that it checks for a comma , in thi
Peter Lauri wrote:
> Hi,
>
>
>
> How do I add so that it checks for a comma , in this preg_match. I think the
> documentation is not that good for the pref_match:
it's a lot better than you spelling of preg_match. the subject of regexps is
very
complex, the documentation reflects that - but t
On 09/08/06, Peter Lauri <[EMAIL PROTECTED]> wrote:
Hi,
How do I add so that it checks for a comma , in this preg_match. I think
the
documentation is not that good for the pref_match:
preg_match('/^[a-z0-9-_\'() +]*$/i', $s);
Check for a comma inside a range - use a comma!
--
h
This one time, at band camp, "Jeff" <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> Regex pattern question here. I need to match on "Foo-F00", "Foo-foo",
> "foo-Foo". I know in perl you can use the /i to specify "case
> insensitive" matching. Is there any such switch that can be used in
> preg_match
On Fri, April 21, 2006 10:44 am, Jeff wrote:
> Regex pattern question here. I need to match on "Foo-F00", "Foo-foo",
> "foo-Foo". I know in perl you can use the /i to specify "case
> insensitive" matching. Is there any such switch that can be used in
> preg_match() in PHP?
If you go to the http
On Friday 21 April 2006 9:44 am, Jeff wrote:
> Regex pattern question here. I need to match on "Foo-F00", "Foo-foo",
> "foo-Foo". I know in perl you can use the /i to specify "case
> insensitive" matching. Is there any such switch that can be used in
> preg_match() in PHP?
http://us3.php.net/m
On 4/1/06, Benjamin D Adams <[EMAIL PROTECTED]> wrote:
> I'm trying to check a string for ../
> if(preg_match("/..//i", $string)){
> echo "string has ../";
> }
> ?>
>
> Can't get it to work can anyone help?
Since / is your delimiter you need to escape it.
Also '.'
Benjamin D Adams wrote:
I'm trying to check a string for ../
Can't get it to work can anyone help?
That's terrible overkill. Regex is not designed for simple substring
matching. You want:
if( strpos( $string, '../' ) !== false )
echo 'string has ../';
By the way, your problem is t
On Thu, 08 Sep 2005 16:36:36 +0100, Steve Turnbull wrote:
> On Thu, 08 Sep 2005 09:15:03 +0100, Steve Turnbull wrote:
>
>> On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:
>>
>>> Steve Turnbull wrote:
I am trying to find a regular expression to match a variable, what I think
On Thu, 08 Sep 2005 09:15:03 +0100, Steve Turnbull wrote:
> On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:
>
>> Steve Turnbull wrote:
>>> I am trying to find a regular expression to match a variable, what I think
>>> should work (but doesn't) is;
>>>
>>> preg_match ('^/[\w],[\w]
On 08 September 2005 09:15, Steve Turnbull wrote:
> On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:
>
> > Steve Turnbull wrote:
> > > I am trying to find a regular expression to match a variable,
> > > what I think should work (but doesn't) is;
> > >
> > > preg_match ('^/[\w],[\
1 - 100 of 222 matches
Mail list logo