Dear list -
I've tried everything and am still stuck.
A regex that will accept numbers, letters, comma, period and no other
characters
Thanks.
Ethan Rosenberg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
#[0-9a-zA-Z,.]#
2012/7/27 Ethan Rosenberg eth...@earthlink.net
Dear list -
I've tried everything and am still stuck.
A regex that will accept numbers, letters, comma, period and no other
characters
Thanks.
Ethan Rosenberg
--
PHP General Mailing List (http://www.php.net/)
To
On 27 Jul 2012, at 18:07, Ethan Rosenberg eth...@earthlink.net wrote:
I've tried everything and am still stuck.
A regex that will accept numbers, letters, comma, period and no other
characters
/^[0-9a-zA-Z,\.]+$/
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General
Hi,
Am 27.07.2012 19:07, schrieb Ethan Rosenberg:
Dear list -
I've tried everything and am still stuck.
A regex that will accept numbers, letters, comma, period and no other
characters
This?
/^[0-9a-zA-Z,.]$/
Regards,
Sebastian
Thanks.
Ethan Rosenberg
--
PHP General Mailing
Simon Dániel simondan...@gmail.com wrote:
#[0-9a-zA-Z,\.]#
You should escape out that period as it will match any character otherwise.
Thanks,
Ash
http://ashleysheridan.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, Jul 27, 2012 at 10:16 AM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
Simon Dániel simondan...@gmail.com wrote:
#[0-9a-zA-Z,\.]#
You should escape out that period as it will match any character otherwise
The dot only matches a period inside a character class [...].
David
#[0-9a-zA-Z,\.]#
You should escape out that period as it will match any character otherwise.
Thanks,
Ash
Ash, Thats not true. In character class only meta-characters are \ ^ - [
and ]. This is the rule of PCRE (see
Am 27.07.2012 19:54, schrieb shiplu:
#[0-9a-zA-Z,\.]#
You should escape out that period as it will match any character otherwise.
Thanks,
Ash
Ash, Thats not true. In character class only meta-characters are \ ^ - [
And the dash only when it's not the first, or the last in the class.
-Original Message-
From: Camilo Sperberg [mailto:unrea...@gmail.com]
Sent: Tuesday, August 09, 2011 5:27 PM
For the first one, it may be that zend studio does have an internal script
to do the job. Check the general preferences tab, template stuff.
Nope. Nothing there. Those
On 10-08-2011, at 16:54, Daevid Vincent wrote:
-Original Message-
From: Camilo Sperberg [mailto:unrea...@gmail.com]
Sent: Tuesday, August 09, 2011 5:27 PM
For the first one, it may be that zend studio does have an internal script
to do the job. Check the general preferences tab,
I've inherited a bunch of code and the previous developers have done two
things that are really bugging me and I want to clean up.
[a] They use short-tag ? instead of ?php. Anyone have some good
search/replace style Regex (ideally for ZendStudio/Eclipse) that will run
through all the files in
For the first one, it may be that zend studio does have an internal script to
do the job. Check the general preferences tab, template stuff. Please note that
?= is also valid and should be replaced to ?php echo instead. Also the
short if version 1 == 1 ? True : false should be replaced if i'm
Hi.
I'm hoping someone can help me extract text between double quotes from a
string.
$regex = 'some magic';
$r = preg_match($regex, $sentence, $phrases);
So, if
$sentence = 'Dave said This is it. Nope, that is the wrong colour she
replied.';
I want $phrases to contain 'This is it' and
Le 19/02/2011 0:23, Tommy Pham a écrit :
@Simon,
Thanks for explaining about the [^href]. I need to read up more about
greediness. I thought I understood it but guess not.
@Peter,
I tried your pattern but it didn't capture all of my new test cases.
Also, it captures the single/double quotes
Hi folks,
This is not directly relating to PHP but it's Friday so I'm gonna give
it a shot :). Would someone please help me figure out why my regex
pattern doesn't work. Below is the code and sample data:
$html = HTML
li class=small tab a class=y-mast-link images
As far as I can tell, your problem lies in [^href]*. That will match any
characters other than h, r, e or f, not anything other than the string href.
Consider replacing it with [^]*?. The ? makes it non-greedy so it will stop as
soon as it can (when it matches the first href) rather than as
On 18 February 2011 22:36, Tommy Pham tommy...@gmail.com wrote:
Hi folks,
This is not directly relating to PHP but it's Friday so I'm gonna give
it a shot :). Would someone please help me figure out why my regex
pattern doesn't work. Below is the code and sample data:
$html = HTML
li
@Simon,
Thanks for explaining about the [^href]. I need to read up more about
greediness. I thought I understood it but guess not.
@Peter,
I tried your pattern but it didn't capture all of my new test cases.
Also, it captures the single/double quotes in addition to the
fragments inside the
A slightly more complex problem than phone numbers ...
It is a sort of convention to use the format 'JohnDoeSMITH' or 'John Doe SMITH'
where each forename starts with a capital and the surname is in upper case. I
have a crude method of scanning for the capitals and splitting this to give me
On Sat, 2011-01-01 at 09:46 +, Lester Caine wrote:
A slightly more complex problem than phone numbers ...
It is a sort of convention to use the format 'JohnDoeSMITH' or 'John Doe
SMITH'
where each forename starts with a capital and the surname is in upper case. I
have a crude method
Ethan Rosenberg wrote:
FYI [to all the list] -- I thank all for their input. I only needed US
phones, and I am forcing the user of the form to conform to xxx-xxx-
as the input format.
out of interest, why are you forcing you're users to conform to that
input format? you could simply
At 07:11 AM 12/31/2010, Nathan Rixham wrote:
Ethan Rosenberg wrote:
FYI [to all the list] -- I thank all for their input. I only
needed US phones, and I am forcing the user of the form to conform
to xxx-xxx- as the input format.
out of interest, why are you forcing you're users to
://www.ashleysheridan.co.uk
- Reply message -
From: Ethan Rosenberg eth...@earthlink.net
Date: Fri, Dec 31, 2010 14:03
Subject: [PHP] Regex for telephone numbers
To: Nathan Rixham nrix...@gmail.com
Cc: php-general@lists.php.net php-general@lists.php.net
At 07:11 AM 12/31/2010, Nathan Rixham wrote
my mobile as a means of contact.
Thanks,
Ash
http://www.ashleysheridan.co.ukhttp://www.ashleysheridan.co.uk
- Reply message -
From: Ethan Rosenberg eth...@earthlink.net
Date: Fri, Dec 31, 2010 14:03
Subject: [PHP] Regex for telephone numbers
To: Nathan Rixham nrix...@gmail.com
Cc: php
Ethan Rosenberg wrote:
At 07:11 AM 12/31/2010, Nathan Rixham wrote:
Ethan Rosenberg wrote:
FYI [to all the list] -- I thank all for their input. I only needed
US phones, and I am forcing the user of the form to conform to
xxx-xxx- as the input format.
out of interest, why are you
a...@ashleysheridan.co.uk wrote:
Sorry for top-post, on phone.
What about mobile phone numbers (cell phones you call them in the US)
do they conform to the same format?
AFAIK, they too vary from country to country. Swiss mobile numbers are
07[6789] NNN, the latter usually written as
On Fri, Dec 31, 2010 at 11:04, Per Jessen p...@computer.org wrote:
AFAIK, they too vary from country to country. Swiss mobile numbers are
07[6789] NNN, the latter usually written as NNN NN NN, but also
often in a way that will help remembering the number.
Danish mobile#s are the same as
I guess, this will work fine
ereg('[0-9]{3}-[0-9]{3}-[0-9]{4}', $phone_number);
On Thu, Dec 30, 2010 at 2:12 AM, Ethan Rosenberg eth...@earthlink.netwrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate
On Fri, Dec 31, 2010 at 12:05, Dmitriy Ugnichenko
mitya.ugniche...@gmail.com wrote:
I guess, this will work fine
ereg('[0-9]{3}-[0-9]{3}-[0-9]{4}', $phone_number);
Not quite. Plus, all ereg* functions have been deprecated for
some time now.
--
/Daniel P. Brown
Network Infrastructure
On Wed, 2010-12-29 at 19:35 -0500, Daniel P. Brown wrote:
On Wed, Dec 29, 2010 at 19:12, Ethan Rosenberg eth...@earthlink.net wrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone
On 12/29/2010 4:35 PM, Daniel P. Brown wrote:
On Wed, Dec 29, 2010 at 19:12, Ethan Rosenberg eth...@earthlink.net wrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone number
is in the format
On Fri, Dec 31, 2010 at 19:09, Jim Lucas li...@cmsws.com wrote:
Actually...
Specified here [1] it says that the {1,} is the same as '+'. I think you
should
drop the comma. If you don't this would be valid 844-2345-123456
^[2-9]{1,}[0-9]{2,}\-[2-9]{1,}[0-9]{2,}\-[0-9]{4,}$
should be
At 07:27 PM 12/29/2010, Josh Kehn wrote:
On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg eth...@earthlink.net wrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a
telephone number is in the format
On Thu, Dec 30, 2010 at 14:07, Ethan Rosenberg eth...@earthlink.net wrote:
Josh -
I used use \d{3}-\d{3}-\d{4}.
It works beautifully!!
Just keep in mind that invalid numbers will also pass that check,
such as 000-000- or 123-456-6789. That's why my example was a bit
more involved.
On Dec 29, 2010, at 6:12 PM, Ethan Rosenberg wrote:
I would like to have a regex which would validate that a telephone
number is in the format xxx-xxx-.
http://lmgtfy.com/?q=regex+to+validate+US+phone+numbers
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone
number is in the format xxx-xxx-.
Thanks.
Ethan
MySQL 5.1 PHP 5 Linux [Debian (sid)]
--
PHP General Mailing List
I suggest you try javascript.
Richard L. Buskirk
-Original Message-
From: Ethan Rosenberg [mailto:eth...@earthlink.net]
Sent: Wednesday, December 29, 2010 7:12 PM
To: php-db-lists.php.net; php-general@lists.php.net
Subject: [PHP] Regex for telephone numbers
Dear List -
Thank you
On 30/12/2010, at 1:12 PM, Ethan Rosenberg wrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone number is
in the format xxx-xxx-.
Thanks.
Ethan
MySQL 5.1 PHP 5 Linux
; php-general@lists.php.net
Subject: [PHP] Regex for telephone numbers
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone
number is in the format xxx-xxx-.
Thanks.
Ethan
MySQL 5.1 PHP 5 Linux
On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg eth...@earthlink.net wrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone number is
in the format xxx-xxx-.
Thanks.
Ethan
Hi Ethan,
Could you do a string compare and check at certain characters for a
dash?
IE:
check the second character to see if it is a dash for 1-800...
if that is not a dash, check the fourth character for a dash, 469-9...
then the other places where dashes would be based on those two
You could also help them out a little with something like..
$phone = str_replace((, , $phone);
$phone = str_replace(), -, $phone);
HTH,
Karl
On Dec 29, 2010, at 6:27 PM, Josh Kehn wrote:
On Dec 29, 2010, at 7:12 PM, Ethan Rosenberg eth...@earthlink.net
wrote:
Dear List -
Thank you
Why not have three separate fields for each part, as that way you don't
need to bother about how the user separates them, as trust me, if they
can break it, they will.
I have found it is best to always limit the amount of free entry you
permit a user, as that will drastically cut back in data
On Wed, Dec 29, 2010 at 19:12, Ethan Rosenberg eth...@earthlink.net wrote:
Dear List -
Thank you for all your help in the past.
Here is another one
I would like to have a regex which would validate that a telephone number
is in the format xxx-xxx-.
Congrats. People in Hell
I'm looking for a regular expression to accomplish a specific task.
I'm hoping someone who's really good at regex patterns can lend a quick hand.
I need a regex pattern that will grab URLs out of HTML that have a
certain link text. (i.e. the word Continue)
This is what I have so far but it does
Brad Fuller wrote:
I'm looking for a regular expression to accomplish a specific task.
I'm hoping someone who's really good at regex patterns can lend a quick hand.
I need a regex pattern that will grab URLs out of HTML that have a
certain link text. (i.e. the word Continue)
This is
On Fri, 2009-10-23 at 13:23 -0400, Brad Fuller wrote:
I'm looking for a regular expression to accomplish a specific task.
I'm hoping someone who's really good at regex patterns can lend a quick hand.
I need a regex pattern that will grab URLs out of HTML that have a
certain link text.
On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Fri, 2009-10-23 at 13:23 -0400, Brad Fuller wrote:
I'm looking for a regular expression to accomplish a specific task.
I'm hoping someone who's really good at regex patterns can lend a quick hand.
I need a
On Fri, 2009-10-23 at 13:45 -0400, Brad Fuller wrote:
On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Fri, 2009-10-23 at 13:23 -0400, Brad Fuller wrote:
I'm looking for a regular expression to accomplish a specific task.
I'm hoping someone who's
On Fri, Oct 23, 2009 at 1:48 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Fri, 2009-10-23 at 13:45 -0400, Brad Fuller wrote:
On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Fri, 2009-10-23 at 13:23 -0400, Brad Fuller wrote:
I'm
On Fri, Oct 23, 2009 at 1:48 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Fri, 2009-10-23 at 13:45 -0400, Brad Fuller wrote:
On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Fri, 2009-10-23 at 13:23 -0400, Brad Fuller wrote:
I'm looking
On Fri, Oct 23, 2009 at 1:54 PM, Israel Ekpo israele...@gmail.com wrote:
On Fri, Oct 23, 2009 at 1:48 PM, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
On Fri, 2009-10-23 at 13:45 -0400, Brad Fuller wrote:
On Fri, Oct 23, 2009 at 1:28 PM, Ashley Sheridan
On Fri, Oct 23, 2009 at 01:54:40PM -0400, Brad Fuller wrote:
Thanks Ash you are awesome!
Brad, you're violating list rules. We never say that kind of thing to
Ash *where he can hear it*. Only behind his back. ;-}
Paul
--
Paul M. Foster
--
PHP General Mailing List (http://www.php.net/)
To
On Fri, 2009-10-23 at 15:17 -0400, Paul M Foster wrote:
On Fri, Oct 23, 2009 at 01:54:40PM -0400, Brad Fuller wrote:
Thanks Ash you are awesome!
Brad, you're violating list rules. We never say that kind of thing to
Ash *where he can hear it*. Only behind his back. ;-}
Paul
--
Hi there,
I am trying to remove multiple linebreakes from a textarea input.
Spammers tend to insert multiple line breakes. The problem is, that I
want to allow 2 line breaks so basic formating should be allowed.
I am doing this by regex:
$data[txt] = preg_replace('`[\r\n]+`',\n,$data[txt]);
: Merlin Morgenstern merli...@fastmail.fm
Para: php-general@lists.php.net
Enviado: mié,14 octubre, 2009 12:17
Asunto: [PHP] regex for multiple line breakes
Hi there,
I am trying to remove multiple linebreakes from a textarea input. Spammers tend
to insert multiple line breakes. The problem is, that I
Morgenstern merli...@fastmail.fm
Para: php-general@lists.php.net
Enviado: mié,14 octubre, 2009 12:17
Asunto: [PHP] regex for multiple line breakes
Hi there,
I am trying to remove multiple linebreakes from a textarea input. Spammers tend
to insert multiple line breakes. The problem is, that I want
] = preg_replace('`[\r\n]{2,}`',\n,$data[txt]);
De: Merlin Morgenstern merli...@fastmail.fm
Para: php-general@lists.php.net
Enviado: mié,14 octubre, 2009 12:17
Asunto: [PHP] regex for multiple line breakes
Hi there,
I am trying to remove
a...@ashleysheridan.co.uk
Para: Merlin Morgenstern merli...@fastmail.fm
CC: php-general@lists.php.net
Enviado: mié,14 octubre, 2009 12:44
Asunto: Re: [PHP] regex for multiple line breakes
On Wed, 2009-10-14 at 12:42 +0200, Merlin Morgenstern wrote:
That sounds very logical but does not work
] = preg_replace('`[\r\n]{2,}`',\n,$data[txt]);
De: Merlin Morgenstern merli...@fastmail.fm
Para: php-general@lists.php.net
Enviado: mié,14 octubre, 2009 12:17
Asunto: [PHP] regex for multiple line breakes
Hi there,
I am trying to remove multiple linebreakes from
Hi Folks,
I have a serious problem.
must create a regular expression against all that is between single quote or
double quotes. Easy? Ok, i know, but i need that everything must to be too
an single quote or double quote.
If i have this SQL command:
SELECT * FROM TSTRENIC.MEI_ACESSO WHERE
Hi there,
I am trying to filter out content that is not ascii. Can I do this with
regex? For example:
$regex = '[AZ][09]';
if (preg_match($regex, $text)) {
return TRUE;
}
else {
return FALSE;
}
The reason I need to do
Hi Merlin,
I think the pattern you're looking for is '/[a-zA-Z0-9]/' which will
match all alphanumeric characters.
Cheers
Stuart
On 30 Jul 2009, at 19:13, Merlin Morgenstern wrote:
Hi there,
I am trying to filter out content that is not ascii. Can I do this
with regex? For example:
Merlin Morgenstern wrote:
Hi there,
I am trying to filter out content that is not ascii. Can I do this with
regex? For example:
$regex = '[AZ][09]';
if (preg_match($regex, $text)) {
return TRUE;
}
else {
return FALSE;
}
The reason I need to do
Merlin Morgenstern wrote:
Hi there,
I am trying to filter out content that is not ascii. Can I do this with
regex? For example:
$regex = '[AZ][09]';
if (preg_match($regex, $text)) {
return TRUE;
}
else {
return FALSE;
}
The reason I need to do
Hi there,
I am trying to remove a text which does contain a : inside. Somehow the
regex does not match, no matter what I do:
$contents = mb_ereg_replace('^(.*)this is the test: replace(.*)$', '',
$contents ,'UTF-8');
Looks like this is a result of the :.
Does anybody have an idea how to
[mailto:merli...@fastmail.fm]
Sent: Wednesday, April 22, 2009 4:09 AM
To: php-general@lists.php.net
Subject: [PHP] Regex not working with :
Hi there,
I am trying to remove a text which does contain a : inside. Somehow the
regex does not match, no matter what I do:
$contents = mb_ereg_replace
,
Kyle
-Original Message-
From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
Sent: Wednesday, April 22, 2009 4:09 AM
To: php-general@lists.php.net
Subject: [PHP] Regex not working with :
Hi there,
I am trying to remove a text which does contain a : inside. Somehow the
regex does
that it's the :?
HTH,
Kyle
-Original Message-
From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
Sent: Wednesday, April 22, 2009 4:09 AM
To: php-general@lists.php.net
Subject: [PHP] Regex not working with :
Hi there,
I am trying to remove a text which does contain a : inside. Somehow
jesse.ha...@arvatousa.com schreef:
Hi,
Brand new to regex. So I have a cli which runs a regex on users input,
to make sure that only 0-9 and A-Z are accepted. It should strip
everything else. My problem is that when you press control-Z (on
Windows; I have not yet tested this on linux,
From: Nitsan Bin-Nun
If you can point me on the character which control-z creates it would
make
it easier, I have no idea of it ;)
On Thu, Mar 26, 2009 at 11:06 PM, jesse.ha...@arvatousa.com wrote:
Thanks again. Sad to say, same result.
The second option looped an error: Warning:
Hazen
-Original Message-
From: Jochem Maas [mailto:joc...@iamjochem.com]
Sent: Thursday, March 26, 2009 11:45 PM
To: Hazen, Jesse, arvato digital services llc
Cc: php-general@lists.php.net
Subject: Re: [PHP] Regex
jesse.ha...@arvatousa.com schreef:
Hi,
Brand new to regex. So I have
, 2009 5:23 PM
To: Hazen, Jesse, arvato digital services llc; php-general@lists.php.net
Subject: RE: [PHP] Regex
hi...
if you haven't solved your issue... can you tell me in detail what
you're trying to accomplish? what are the steps to running the script?
thanks
-Original Message-
From
: php-general@lists.php.net
Subject: Re: [PHP] Regex
jesse.ha...@arvatousa.com schreef:
Hi,
Brand new to regex. So I have a cli which runs a regex on users input,
to make sure that only 0-9 and A-Z are accepted. It should strip
everything else. My problem is that when you press control-Z
I'm normally OK with regex, especially if I fiddle with it long enough,
however I have fiddled with this one so long that I'm either totally
missing it or it's something simple. Does it have anything to do with
the backref, or the fact that the value of the backref has a $? I have:
$out = '
On Fri, Mar 27, 2009 at 9:40 AM, Shawn McKenzie nos...@mckenzies.net wrote:
I'm normally OK with regex, especially if I fiddle with it long enough,
however I have fiddled with this one so long that I'm either totally
missing it or it's something simple. Does it have anything to do with
the
haliphax wrote:
On Fri, Mar 27, 2009 at 9:40 AM, Shawn McKenzie nos...@mckenzies.net wrote:
I'm normally OK with regex, especially if I fiddle with it long enough,
however I have fiddled with this one so long that I'm either totally
missing it or it's something simple. Does it have anything
Hi,
Brand new to regex. So I have a cli which runs a regex on users input,
to make sure that only 0-9 and A-Z are accepted. It should strip
everything else. My problem is that when you press control-Z (on
Windows; I have not yet tested this on linux, and I will, but I would
like this to be
To filter out everything which is not A-Z, a-z and 0-9 try this regex:
$str = preg_replace(#[^a-zA-Z0-9]+#is, , $str);
On Thu, Mar 26, 2009 at 10:23 PM, jesse.ha...@arvatousa.com wrote:
Hi,
Brand new to regex. So I have a cli which runs a regex on users input,
to make sure that only 0-9
, 2009 1:44 PM
To: Hazen, Jesse, arvato digital services llc
Cc: php-general@lists.php.net
Subject: Re: [PHP] Regex
To filter out everything which is not A-Z, a-z and 0-9 try this regex:
$str = preg_replace(#[^a-zA-Z0-9]+#is, , $str);
On Thu, Mar 26, 2009 at 10:23 PM, jesse.ha...@arvatousa.com
*To:* Hazen, Jesse, arvato digital services llc
*Cc:* php-general@lists.php.net
*Subject:* Re: [PHP] Regex
To filter out everything which is not A-Z, a-z and 0-9 try this regex:
$str = preg_replace(#[^a-zA-Z0-9]+#is, , $str);
On Thu, Mar 26, 2009 at 10:23 PM, jesse.ha...@arvatousa.com
] On Behalf Of
Nitsan Bin-Nun
Sent: Thursday, March 26, 2009 1:58 PM
To: Hazen, Jesse, arvato digital services llc
Cc: php-general@lists.php.net
Subject: Re: [PHP] Regex
I have no idea about this control-Z thing, you might want to try it with
UTF (just add the 'u' modificator):
$str = preg_replace
digital services llc
*Cc:* php-general@lists.php.net
*Subject:* Re: [PHP] Regex
I have no idea about this control-Z thing, you might want to try it with
UTF (just add the 'u' modificator):
$str = preg_replace(#[^a-zA-Z0-9]+#uis, , $str);
Or try this:
$str = preg_replace(#(\b[^a-zA-Z0-9]\b
it.
Thanks,
Jesse Hazen
From: nit...@binnun.co.il [mailto:nit...@binnun.co.il] On Behalf Of
Nitsan Bin-Nun
Sent: Thursday, March 26, 2009 2:09 PM
To: Hazen, Jesse, arvato digital services llc
Cc: php-general@lists.php.net
Subject: Re: [PHP] Regex
If you can point
: jesse.ha...@arvatousa.com [mailto:jesse.ha...@arvatousa.com]
Sent: Thu 3/26/2009 2:17 PM
To: nitsa...@gmail.com
Cc: php-general@lists.php.net
Subject: RE: [PHP] Regex
Nitsan,
Not a problem, thanks for the help. So, it is printed as ^Z. However, I
created a little test.php script to accept input
-general@lists.php.net
Subject: [PHP] Regex
Hi,
Brand new to regex. So I have a cli which runs a regex on users input,
to make sure that only 0-9 and A-Z are accepted. It should strip
everything else. My problem is that when you press control-Z (on
Windows; I have not yet tested this on linux
jesse.ha...@arvatousa.com wrote:
Nistan,
Just got home, tested on linux. No problem on linux, the control-z just
exits. I may just go ahead and post my issue to the PHP windows list to see
if anything comes up, and not worry if it doesnt. I appreciate the help very
much
Thanks,
Hello,
I have a quirky behavior I'm trying to resolve.
I have a REGEX that will find a function definition in a php file:
.function InsertQuery($table,$fields,$values).
the REGEX is:
$regex='/function [a-z]* *([$a-zA-Z]*)/';
the problem is that:
1. a slash is automattically put in front
-Original Message-
From: MikeP [mailto:mpel...@princeton.edu]
Sent: Thursday, December 18, 2008 8:43 AM
To: php-general@lists.php.net
Subject: [PHP] Regex Problem
Hello,
I have a quirky behavior I'm trying to resolve.
I have a REGEX that will find a function definition in a php
Boyd, Todd M. tmbo...@ccis.edu wrote in message
news:33bde0b2c17eef46acbe00537cf2a190037b7...@exchcluster.ccis.edu...
-Original Message-
From: MikeP [mailto:mpel...@princeton.edu]
Sent: Thursday, December 18, 2008 8:43 AM
To: php-general@lists.php.net
Subject: [PHP] Regex Problem
For a Form Validation process, I need a function to avoid Latin characters
to be provided as the first or last name. Since we expect our users to
enter their personal info in Persian.
Do you know any regular expression to provide this functionality?
1) Regex to check whether there are Latin
Hi Behzad,
I would try a different approach ...
EXAMPLE (UTF-8):
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
Thanks everyone. I guess I find the answer:
*// return true if the $str ONLY consists of Arabic characters and
space-character
public function isArabicString($str)
{
return preg_match('/^([\p{Arabic}]|\s)*$/u', $str);
}
*
PHP 5.1.x or higher is required.
@see:
Dear List,
For a Form Validation process, I need a function to avoid Latin characters
to be provided as the first or last name. Since we expect our users to
enter their personal info in Persian.
Do you know any regular expression to provide this functionality?
1) Regex to check whether there are
After ceo posted about the imap function I was eager to try it out
and got rather disappointed pretty soon.
imap_rfc822_parse_adrlist() should not be used for email validation!
EXAMPLE:
?php
var_dump(imap_rfc822_parse_adrlist('! # $ % * + - / = ? ^ _ ` { |
} ~', ''));
?
The above code will
var_dump(imap_rfc822_parse_adrlist('! # $ % * + - / = ? ^ _ ` { | } ~',
''));
This looks like a valid localhost email address to me...
What's wrong with it?
:-v
You may want to check that host is non-empty, if you do not expect any
localhost users, and fail on that condition,
ceo wrote:
var_dump(imap_rfc822_parse_adrlist('! # $ % * + - / = ? ^ _ ` { | } ~',
''));
This looks like a valid localhost email address to me...
It surely is a valid localhost email address, but what most people
(and the OP) usually need is to validate a full email string with a
local and a
On Tue, Oct 28, 2008 at 8:57 PM, VamVan [EMAIL PROTECTED] wrote:
SSO process:
$_POST the Email Address and password
Get Authenticated, Get the COOKIE ( Through Oracle IDM suite SOAP call)
Decrypt the COOKIE ( Through Oracle Enterprise business suite SOAP call)
and get the profile Info
When it comes to email validation, I would recommend using the IMAP function
which will be both fast and correct:
http://us.php.net/manual/en/function.imap-rfc822-parse-adrlist.php
Otherwise, it's guaranteed that you are having at least some false positives,
and probably some false
On Wed, Oct 29, 2008 at 5:36 AM, [EMAIL PROTECTED] wrote:
When it comes to email validation, I would recommend using the IMAP function
which will be both fast and correct:
http://us.php.net/manual/en/function.imap-rfc822-parse-adrlist.php
Otherwise, it's guaranteed that you are having at
1 - 100 of 733 matches
Mail list logo