[PHP] Regex validation

2008-10-28 Thread VamVan
Hello Team of Nerds, I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; I want to a pregmatch for these characters on my whole email address and if match is found I need to return false. Thank you

Re: [PHP] Regex validation

2008-10-28 Thread Daniel P. Brown
On Tue, Oct 28, 2008 at 4:10 PM, VamVan [EMAIL PROTECTED] wrote: Hello Team of Nerds, I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; Then you need to STFW and RTFM. PHP uses Perl-style regexp's, by the

Re: [PHP] Regex validation

2008-10-28 Thread Richard Heyes
Hello Team of Nerds, Not the best way to start your request for help. I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; I want to a pregmatch for these characters on my whole email address and if match is

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
VamVan wrote: Hello Team of Nerds, I need help in writing a regular expression for this: invalid character set is: INVALID_STRING={/,*,+,(,),'\',:,;,~,..,.@,@.}; I want to a pregmatch for these characters on my whole email address and if match is found I need to return false.

RE: [PHP] Regex validation

2008-10-28 Thread Boyd, Todd M.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Heyes Sent: Tuesday, October 28, 2008 4:30 PM To: VamVan Cc: php List Subject: Re: [PHP] Regex validation Hello Team of Nerds, Not the best way to start your request for help. I

Re: [PHP] Regex validation

2008-10-28 Thread Yeti
If your trying to filter E-Mail addresses, then filter_var is what you should use: http://php.net/filter_var If the OP (original poster) got PHP5+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regex validation

2008-10-28 Thread Nitsan Bin-Nun
Good to know filter_var() exists in PHP5 Unless you have PHP5 you better validate the string in the way of checking if it is fit's to your allowed characters and not checking if it contains the NOT allowed charaters. You better use: [a-z0-9A-Z\_\.]+ instead of [^\)\(\*\[EMAIL PROTECTED] and I

Re: [PHP] Regex validation

2008-10-28 Thread VamVan
Thank Guys, I at least got part of it working , not the double words but almost everything else than that: function _email_validate($mail_address){ $invalid_charset_pattern = [(*+?)|~:;{}/ ]; if(ereg($invalid_charset_pattern, $mail_address)){ return false; }else{ return true; } }

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
Keep in mind that ereg will disappear with PHP 6. You might want to use the preg functions: http://www.making-the-web.com/2007/09/21/becoming-php-6-compatible/ Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com VamVan wrote: Thank Guys, I at least got part

Re: [PHP] Regex validation

2008-10-28 Thread Ashley Sheridan
On Tue, 2008-10-28 at 18:07 -0500, Micah Gersten wrote: Keep in mind that ereg will disappear with PHP 6. You might want to use the preg functions: http://www.making-the-web.com/2007/09/21/becoming-php-6-compatible/ Thank you, Micah Gersten onShore Networks Internal Developer

Re: [PHP] Regex validation

2008-10-28 Thread VamVan
Yeah, I understand that its allowed in RFC. But unfortunately I use SSO layer which decrypts the Cookie to get email address. This is where it messes up. So I have decided not to allow people to use that as well. Thanks On Tue, Oct 28, 2008 at 5:10 PM, Ashley Sheridan [EMAIL PROTECTED]wrote:

Re: [PHP] Regex validation

2008-10-28 Thread Lupus Michaelis
VamVan a écrit : This is where it messes up. So I have decided not to allow people to use that as well. By that way, you're making a lot of ennemies on this very list :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
What are you talking about with a cookie and an E-Mail address? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com VamVan wrote: Yeah, I understand that its allowed in RFC. But unfortunately I use SSO layer which decrypts the Cookie to get email address.

Re: [PHP] Regex validation

2008-10-28 Thread VamVan
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 Thats what happens now. But there is a glitch in the decryption

Re: [PHP] Regex validation

2008-10-28 Thread Micah Gersten
How is anything but your webserver decrypting the $_POST data? PHP should get it after that as is. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com VamVan wrote: SSO process: $_POST the Email Address and password Get Authenticated, Get the COOKIE (

[PHP] Regex help

2008-09-09 Thread Jason Pruim
Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112 Here are my current matching patterns: RewriteRule

RE: [PHP] Regex help

2008-09-09 Thread Boyd, Todd M.
-Original Message- From: Jason Pruim [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2008 7:30 AM To: PHP-General List Subject: [PHP] Regex help Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match

Re: [PHP] Regex for email validation

2008-08-30 Thread Per Jessen
tedd wrote: However, it's one thing to have a keyboard designed for a specific language and another to be able to enter code-points that aren't associated with any specific language (i.e., Dingbats and Math Symbols). Ah yes, that's true. How about an APL2 keyboard then? :-) For example,

Re: [PHP] Regex for email validation

2008-08-30 Thread Per Jessen
tedd wrote: But as it is now, it's not so much IF the domain name is easy to type in or not, but rather does the Rx.com show up in the URL once you get there? And it does for most browsers other than IE. You can get to the site very easily, try typing: http://rx-2.com That wasn't

Re: [PHP] Regex for email validation

2008-08-30 Thread Per Jessen
Per Jessen wrote: tedd wrote: But as it is now, it's not so much IF the domain name is easy to type in or not, but rather does the Rx.com show up in the URL once you get there? And it does for most browsers other than IE. You can get to the site very easily, try typing:

Re: [PHP] Regex for email validation

2008-08-28 Thread Per Jessen
tedd wrote: The WG did solve this issue and came up with a way to do that -- the current algorithm is called PUNYCODE which allows Unicode code-points to appear in a domain name. I know this to be true because I have several domains that lie outside the standard ASCII AND they are real

Re: [PHP] Regex for email validation

2008-08-28 Thread Per Jessen
Kevin Waterson wrote: There is no silver bullet regex to validate all RFC compliant email address. Many have tried, but they all fail at some point. The best you can do is cater to most _sane_ addresses. Exactly - the regex is a quick/cheap sanity check, nothing more. To go all the way,

Re: [PHP] Regex for email validation

2008-08-28 Thread Yeti
That Rx.com domain name is really great stuff, but how do you expect the average user to type it in? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regex for email validation

2008-08-28 Thread Per Jessen
Yeti wrote: That Rx.com domain name is really great stuff, but how do you expect the average user to type it in? Sorry, I don't understand the problem. The average user will obviously have a suitable keyboard, such as this for instance: http://en.wikipedia.org/wiki/Image:KB_Swiss.svg

Re: [PHP] Regex for email validation

2008-08-28 Thread tedd
At 9:29 AM +0200 8/28/08, Yeti wrote: That Rx.com domain name is really great stuff, but how do you expect the average user to type it in? Of course the problem has always been how can the user enter these types of characters from their keyboard. But, that's pretty simply with a Mac and as

Re: [PHP] Regex for email validation

2008-08-28 Thread tedd
At 9:34 AM +0200 8/28/08, Per Jessen wrote: Yeti wrote: That Rx.com domain name is really great stuff, but how do you expect the average user to type it in? Sorry, I don't understand the problem. The average user will obviously have a suitable keyboard, such as this for instance:

[PHP] Regex for email validation

2008-08-27 Thread VamVan
Hello Guys, Does any have a regex for email validation? I need to allow only period and underscore in the local part , we would need a @ and .com or watever for domain. thank you

Re: [PHP] Regex for email validation

2008-08-27 Thread mike
On 8/27/08, VamVan [EMAIL PROTECTED] wrote: Hello Guys, Does any have a regex for email validation? I need to allow only period and underscore in the local part , we would need a @ and .com or watever for domain. php should have a good check built-in. see

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
VamVan wrote: Hello Guys, Does any have a regex for email validation? I need to allow only period and underscore in the local part , we would need a @ and .com or watever for domain. Option 1: /[EMAIL PROTECTED]/ This is probably what you meant: /[EMAIL PROTECTED]/ /Per Jessen,

Re: [PHP] Regex for email validation

2008-08-27 Thread Micah Gersten
That's a very handy extension. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com mike wrote: php should have a good check built-in. see http://www.php.net/manual/en/function.filter-var.php if(!filter_var($var, FILTER_VALIDATE_EMAIL)) { echo invalid

Re: [PHP] Regex for email validation

2008-08-27 Thread Richard Heyes
Does any have a regex for email validation? I need to allow only period and underscore in the local part , we would need a @ and .com or watever for domain. You could: 1. Take the isValidInetAddress() method out of the PEAR Mail_RFC822 class and use that. 2. Use the filter extension which I

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 9:31 AM +0200 8/27/08, Per Jessen wrote: VamVan wrote: Hello Guys, Does any have a regex for email validation? I need to allow only period and underscore in the local part , we would need a @ and .com or watever for domain. Option 1: /[EMAIL PROTECTED]/ This is probably what you

Re: [PHP] Regex for email validation

2008-08-27 Thread Yeti
?php # this one worked fine for me, but it does not cover the full RFC like: name [EMAIL PROTECTED] OR name [EMAIL PROTECTED] $regex = ^[a-z0-9,!#\$%'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%'\*\+/=\?\^_`\{\|}~-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*\.([a-z]{2,})$; if (eregi($regex, $email)) { // do

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
tedd wrote: Option 1: /[EMAIL PROTECTED]/ This is probably what you meant: /[EMAIL PROTECTED]/ /Per Jessen, Zürich Which is probably what you meant: eregi([EMAIL PROTECTED],6}$, $email) Email comes in different TLD flavors. Well, I left that for the OP to figure out. Still, your

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
Yeti wrote: ?php # this one worked fine for me, but it does not cover the full RFC like: name [EMAIL PROTECTED] OR name [EMAIL PROTECTED] $regex = ^[a-z0-9,!#\$%'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%'\*\+/=\ \^_`\{\|}~-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*\.([a-z]{2,})$; For the domain part,

Re: [PHP] Regex for email validation

2008-08-27 Thread Lupus Michaelis
mike a écrit : php should have a good check built-in. see http://www.php.net/manual/en/function.filter-var.php Argh ! Howmany times it is in ? I spent so many time to write a regex that belongs the RFC822 :-/ Because all the regex in answer here was false. They don't allow email like

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
Lupus Michaelis wrote: Argh ! Howmany times it is in ? I spent so many time to write a regex that belongs the RFC822 :-/ Because all the regex in answer here was false. They don't allow email like Mickael Doodoo@lupusmic.com nor That format is about as dead as the dinosaurs. I know it

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 6:30 PM +0200 8/27/08, Per Jessen wrote: Well, I left that for the OP to figure out. Still, your regex is worse - a domain name cannot contain '%'. The only valid characters for a domain name are letters, numbers and a hyphen. Also, maximum length for a domain name is 64 characters, which

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 7:55 PM +0200 8/27/08, Lupus Michaelis wrote: mike a écrit : php should have a good check built-in. see http://www.php.net/manual/en/function.filter-var.php Argh ! Howmany times it is in ? I spent so many time to write a regex that belongs the RFC822 :-/ Because all the regex in

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
tedd wrote: No, they can't. There are no 8-bit characters allowed in an email-address. Check out RFC2821. You can throw all the facts and documentation you want at me, but the left side of the @ has always been open to anything you want. Except anything 8-bit, yes. Seriously, read

Re: [PHP] Regex for email validation

2008-08-27 Thread Lupus Michaelis
Per Jessen a écrit : That format is about as dead as the dinosaurs. Why ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
Lupus Michaelis wrote: Per Jessen a écrit : That format is about as dead as the dinosaurs. Why ? I don't know, but I suspect due to lack of support in popular mailers and mail-servers. Also, the use of quotes does make it cumbersome to work with, both as a user and as a mailserver

Re: [PHP] Regex for email validation

2008-08-27 Thread Lupus Michaelis
Per Jessen a écrit : I don't know, but I suspect due to lack of support in popular mailers and mail-servers. Also, the use of quotes does make it cumbersome to work with, both as a user and as a mailserver admin. I had to write some pieace of code that can handle toto toto@ndd five years

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 8:35 PM +0200 8/27/08, Per Jessen wrote: Go on, send me that email to '[EMAIL PROTECTED]' ... for what it's worth, I can't even define an account like that, so my mailserver might well reject it. Yes, you are right. I was thinking of something else, namely that the LHS of the email

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 8:35 PM +0200 8/27/08, Per Jessen wrote: So, regardless of the documentation, which may be outdated, I know that Unicode characters can be used in IDNS and thus on both sides of the @, You're wrong - IDNs only apply to the right side of the @. (check out what the 'D' means). The D

Re: [PHP] Regex for email validation

2008-08-27 Thread Kevin Waterson
This one time, at band camp, Yeti [EMAIL PROTECTED] wrote: ?php # this one worked fine for me, but it does not cover the full RFC like: name [EMAIL PROTECTED] OR name [EMAIL PROTECTED] $regex = ^[a-z0-9,!#\$%'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%'\*\+/=\?\^_`\{\|}~-]+)[EMAIL

Re: [PHP] Regex for email validation

2008-08-27 Thread mike
Honestly, I'd stick to using php's filter extension. It -should- be the best one out there. If it is not processing something it should, then it's a bug - submit it so all of us benefit :) I am tired of trying to find regexps and all that every time, I put my stock into PHP's core when I can.

[PHP] regex

2008-08-13 Thread Philip Thompson
?php function blegh ($subject) { // I know this pattern doesn't exactly work $pattern = '/(.*).php\?action=([^].*)/'; preg_match ($pattern, $subject, $matches); return $matches; } blegh ('somePage.php?action=doSomethingid='); ? Ok, the important parts that I need to obtain from this

Re: [PHP] Regex in PHP

2008-06-05 Thread Robert Cummings
On Thu, 2008-06-05 at 00:24 -0400, Nathan Nobbe wrote: you really know how to rub it in there rob. but i was looking at the implementation in the php code, looks like somebody likes my idea (this code found in ext/standard/string.c). on the second line the haystack is converted to lower

Re: [PHP] Regex in PHP

2008-06-05 Thread Richard Heyes
sorry to bother you richard. You didn't, I just wanted to make sure I wasn't losing it (more). -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP

Re: [PHP] Regex in PHP

2008-06-04 Thread Richard Heyes
Hi, and the case insensitive versions are a hair faster still ;) Are they? I always thought that case-sensitive functions were faster because they have to test fewer comparisons. Eg To test if i == I in a case-insensitive fashion requires two comparisons (i == I and i == i) whereas a

Re: [PHP] Regex in PHP

2008-06-04 Thread Nathan Nobbe
On Wed, Jun 4, 2008 at 10:10 AM, Richard Heyes [EMAIL PROTECTED] wrote: Hi, and the case insensitive versions are a hair faster still ;) Are they? I always thought that case-sensitive functions were faster because they have to test fewer comparisons. Eg To test if i == I in a

Re: [PHP] Regex in PHP

2008-06-04 Thread Robert Cummings
On Wed, 2008-06-04 at 10:18 -0600, Nathan Nobbe wrote: On Wed, Jun 4, 2008 at 10:10 AM, Richard Heyes [EMAIL PROTECTED] wrote: Hi, and the case insensitive versions are a hair faster still ;) Are they? I always thought that case-sensitive functions were faster because they have

Re: [PHP] Regex in PHP

2008-06-04 Thread Nathan Nobbe
On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings [EMAIL PROTECTED] wrote: Nope, case insensitive is slower since you must make two tests for characters having a lower and upper case version. With case sensitive comparisons you only need to make a single comparison. a quick test shows stripos

Re: [PHP] Regex in PHP

2008-06-04 Thread Nitsan Bin-Nun
I can't find any good reason for regex in this case. you can try to split it with explode / stristr / create a function by your own which goes over the string and check when a @ is catched, something like: function GetDomainName ($a) { $returnDomain = ; $beigale = false; for ($i = 0; $i

Re: [PHP] Regex in PHP

2008-06-04 Thread Robert Cummings
On Wed, 2008-06-04 at 10:56 -0600, Nathan Nobbe wrote: On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings [EMAIL PROTECTED] wrote: Nope, case insensitive is slower since you must make two tests for characters having a lower and upper case version. With case sensitive comparisons you only

Re: [PHP] Regex in PHP

2008-06-04 Thread Nitsan Bin-Nun
at least he have some humer ;-) On 04/06/2008, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2008-06-04 at 10:56 -0600, Nathan Nobbe wrote: On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings [EMAIL PROTECTED] wrote: Nope, case insensitive is slower since you must make two tests for

Re: [PHP] Regex in PHP

2008-06-04 Thread Nathan Nobbe
On Wed, Jun 4, 2008 at 11:12 AM, Robert Cummings [EMAIL PROTECTED] wrote: Did you just try to use a test that used a single iteration to prove me wrong? OMFG ponies!!! Loop each one of those 10 million times, use a separate script for each, and use the system time program to appropriately

Re: [PHP] Regex in PHP

2008-06-04 Thread Robert Cummings
On Wed, 2008-06-04 at 13:12 -0400, Robert Cummings wrote: On Wed, 2008-06-04 at 10:56 -0600, Nathan Nobbe wrote: On Wed, Jun 4, 2008 at 10:26 AM, Robert Cummings [EMAIL PROTECTED] wrote: Nope, case insensitive is slower since you must make two tests for characters having a lower and

Re: [PHP] Regex in PHP

2008-06-04 Thread Robert Cummings
On Wed, 2008-06-04 at 11:18 -0600, Nathan Nobbe wrote: On Wed, Jun 4, 2008 at 11:12 AM, Robert Cummings [EMAIL PROTECTED] wrote: Did you just try to use a test that used a single iteration to prove me wrong? OMFG ponies!!! Loop each one of those 10 million times, use a separate script

Re: [PHP] Regex in PHP

2008-06-04 Thread Nathan Nobbe
On Wed, Jun 4, 2008 at 2:06 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2008-06-04 at 11:18 -0600, Nathan Nobbe wrote: On Wed, Jun 4, 2008 at 11:12 AM, Robert Cummings [EMAIL PROTECTED] wrote: Did you just try to use a test that used a single iteration to prove me wrong?

Re: [PHP] Regex in PHP

2008-06-04 Thread Robert Cummings
On Wed, 2008-06-04 at 23:20 -0400, Nathan Nobbe wrote: i repeated your test using the time program and splitting the script into 2, one for each strpos and stripos, to find similar results. imo, there is no need for 2 comparisons for case-insensitive searches, because both arguments can be

Re: [PHP] Regex in PHP

2008-06-04 Thread Nathan Nobbe
On Wed, Jun 4, 2008 at 11:43 PM, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2008-06-04 at 23:20 -0400, Nathan Nobbe wrote: i repeated your test using the time program and splitting the script into 2, one for each strpos and stripos, to find similar results. imo, there is no need

[PHP] Regex in PHP

2008-06-03 Thread VamVan
Hello All, For example I have these email addressess - [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] What would be my PHP function[Regular expression[ to that can give me some thing like yahoo.com hotmail.com gmail.com Thanks

Re: [PHP] Regex in PHP

2008-06-03 Thread Liran Oz
@lists.php.net Sent: Wednesday, June 04, 2008 3:39 AM Subject: [PHP] Regex in PHP Hello All, For example I have these email addressess - [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] What would be my PHP function[Regular expression[ to that can give me some thing like yahoo.com

Re: [PHP] Regex in PHP

2008-06-03 Thread Nathan Nobbe
On Tue, Jun 3, 2008 at 8:39 PM, VamVan [EMAIL PROTECTED] wrote: Hello All, For example I have these email addressess - [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] What would be my PHP function[Regular expression[ to that can give me some thing like yahoo.com hotmail.com

Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Ryan S
clip preg_match_all('|p[^]*(.*)/p|Ui', $myText, $myArray); /clip Hey! Thanks for replying. Your preg_match_all works like a charm, but for some reason catches only 8 out of 9 paragraphs... its really weird. I have upped the test page to http://www.ezee.se/tests/para_regex2.php.txt so you

Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Shawn McKenzie
Ryan S wrote: clip preg_match_all('|p[^]*(.*)/p|Ui', $myText, $myArray); /clip Hey! Thanks for replying. Your preg_match_all works like a charm, but for some reason catches only 8 out of 9 paragraphs... its really weird. I have upped the test page to

Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Ryan S
clip http://www.ezee.se/tests/para_regex2.php.txt Yep, sorry... Just add the s preg_match_all('|p[^]*(.*)/p|Uis', $myText, $myArray); /clip Swett! It works! If you _do get time_, would love to know the actual meaning of |p[^]*(.*)/p|Uis because although I do appreciate the help and

Re: [PHP] Regex to catch ps (weird result)

2008-05-07 Thread Jon L.
Pretty close. The only thing I'd suggest is a different way of wording step 2: Can contain anything but '' until step 3. As for the switches/modifiers (Uis), check out: http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php U = ungreedy i = case-insensitive (|p| matches 'p' and/or

Re: [PHP] Regex to catch ps

2008-05-07 Thread Aschwin Wesselius
Ryan S wrote: Hey! Thansk for replying! clip It is obvious I haven't had my caffeine yet. This is my last try to get the pattern straight: ?php $html = END_OF_HTML bhello/b b class=blahhello/b pthose/p p class=blahhello/p ahello/a a href=urlthis/a arose/a a href=regex yohello/a anose/a a

Re: [PHP] Regex to catch ps

2008-05-06 Thread Aschwin Wesselius
Ryan S wrote: Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch each of these paragraphs

Re: [PHP] Regex to catch ps

2008-05-06 Thread Aschwin Wesselius
Aschwin Wesselius wrote: Ryan S wrote: Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch

Re: [PHP] Regex to catch ps

2008-05-06 Thread Aschwin Wesselius
Aschwin Wesselius wrote: Aschwin Wesselius wrote: Ryan S wrote: Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have

Re: [PHP] Regex to catch ps

2008-05-06 Thread Shawn McKenzie
Ryan S wrote: clip To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch each of these paragraphs and

[PHP] Regex to catch ps

2008-05-05 Thread Ryan S
Hey all! To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch each of these paragraphs and put then

Re: [PHP] Regex to catch ps

2008-05-05 Thread Eric Butera
On Mon, May 5, 2008 at 9:59 PM, Ryan S [EMAIL PROTECTED] wrote: To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex

Re: [PHP] Regex to catch ps

2008-05-05 Thread Ryan S
clip To say I suck at regex is an understatement so really need any help I can get on this, I have a page of text with different html tags in them, but each block of text has a p or a class=something tag... anybody have any regex that will catch each of these paragraphs and put then

Re: [PHP] regex usage

2008-02-18 Thread Richard Lynch
On Sun, February 17, 2008 9:34 am, Valedol wrote: Is there a mothod to check string`s length with regex or the only way is using strlen? I want string consisting of 4 digits and check string with this code: if (preg_match(/\d{4}/,$_POST[id])) { echo $_POST[id]; } but preg_match

Re: [PHP] regex usage

2008-02-17 Thread Shawn McKenzie
Valedol wrote: Is there a mothod to check string`s length with regex or the only way is using strlen? I want string consisting of 4 digits and check string with this code: if (preg_match(/\d{4}/,$_POST[id])) { echo $_POST[id]; } but preg_match returns true when string consists of 4

Re: [PHP] regex usage

2008-02-17 Thread Richard Heyes
Is there a mothod to check string`s length with regex or the only way is using strlen? I want string consisting of 4 digits and check string with this code: if (preg_match(/\d{4}/,$_POST[id])) { echo $_POST[id]; } but preg_match returns true when string consists of 4 or more digits You

Re: [PHP] regex usage

2008-02-17 Thread Nirmalya Lahiri
--- Valedol [EMAIL PROTECTED] wrote: Is there a mothod to check string`s length with regex or the only way is using strlen? I want string consisting of 4 digits and check string with this code: if (preg_match(/\d{4}/,$_POST[id])) { echo $_POST[id]; } but preg_match returns true

Re: [PHP] regex usage

2008-02-17 Thread Jim Lucas
Valedol wrote: Is there a mothod to check string`s length with regex or the only way is using strlen? I want string consisting of 4 digits and check string with this code: if (preg_match(/\d{4}/,$_POST[id])) { echo $_POST[id]; } but preg_match returns true when string consists of 4 or more

Re: [PHP] regex

2008-01-22 Thread Richard Lynch
You'd need to use a look-ahead or look-behind with PCRE to do this. Search for a thread just last week involving quotes and HTML attributes for an example. PS You could probably get the DB to ignore case in table names and table fields with some kind of set. You also could probably just replace

Re: [PHP] regex

2008-01-22 Thread Richard Lynch
@lists.php.net From: Peter [EMAIL PROTECTED] Subject: Re: [PHP] regex Well actually not a real lot so far. I'm just trial and error(lots of that) at the moment. I've only been 'playing with php for about a month or so. $file = phptest1.txt; $rep = array (tbl_ , _%, bool default 0, bool default 1

[PHP] regex

2008-01-21 Thread Peter
I am trying to convert ms access sql to postgresql using php. I have a sql statement in the form ;- $sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name 1].[Column Name 2] etc. what I want to end up with is $sql = SELECT DISTINCT table_name.column_name, table_name_1.column_name_2,

Re: [PHP] regex

2008-01-21 Thread Keith Roberts
-response protected with TMDA [http://tmda.net] - On Mon, 21 Jan 2008, Peter wrote: To: php-general@lists.php.net From: Peter [EMAIL PROTECTED] Subject: [PHP] regex I am trying to convert ms access sql to postgresql using php. I have

Re: [PHP] regex

2008-01-21 Thread Peter
-the-dead.org.uk All email addresses are challenge-response protected with TMDA [http://tmda.net] - On Mon, 21 Jan 2008, Peter wrote: To: php-general@lists.php.net From: Peter [EMAIL PROTECTED] Subject: [PHP] regex I am trying

Re: [PHP] regex

2008-01-21 Thread Keith Roberts
-response protected with TMDA [http://tmda.net] - On Mon, 21 Jan 2008, Peter wrote: To: php-general@lists.php.net From: Peter [EMAIL PROTECTED] Subject: Re: [PHP] regex Well actually not a real lot so far. I'm just trial and error(lots

Re: [PHP] regex

2008-01-21 Thread Jim Lucas
Peter wrote: I am trying to convert ms access sql to postgresql using php. I have a sql statement in the form ;- $sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name 1].[Column Name 2] etc. what I want to end up with is $sql = SELECT DISTINCT table_name.column_name,

Re: [PHP] regex

2008-01-21 Thread Peter Jackson
Jim Lucas wrote: Peter wrote: I am trying to convert ms access sql to postgresql using php. I have a sql statement in the form ;- $sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name 1].[Column Name 2] etc. what I want to end up with is $sql = SELECT DISTINCT

Re: [PHP] regex

2008-01-21 Thread Peter Jackson
Jim Lucas wrote: Peter wrote: I am trying to convert ms access sql to postgresql using php. I have a sql statement in the form ;- $sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name 1].[Column Name 2] etc. what I want to end up with is $sql = SELECT DISTINCT

[PHP] REGEX: grouping of alternative patterns

2007-10-30 Thread Stijn Verholen
Hey list, I'm having problems with grouped alternative patterns. The regex I would like to use, is the following: /\s*(`?.+`?)\s*int\s*(\(([0-9]+)\))?\s*(unsigned)?\s*(((auto_increment)?\s*(primary\s*key)?)|((not\s*null)?\s*(default\s*(`.*`|[0-9]*)?)?))\s*/i It matches this statement: `id`

Re: [PHP] REGEX: grouping of alternative patterns

2007-10-30 Thread Robin Vickery
On 30/10/2007, Stijn Verholen [EMAIL PROTECTED] wrote: Hey list, I'm having problems with grouped alternative patterns. The regex I would like to use, is the following:

RE: [PHP] REGEX: grouping of alternative patterns

2007-10-30 Thread Ford, Mike
On 30 October 2007 11:07, Stijn Verholen wrote: Hey list, I'm having problems with grouped alternative patterns. The regex I would like to use, is the following: /\s*(`?.+`?)\s*int\s*(\(([0-9]+)\))?\s*(unsigned)?\s*(((auto_i ncrement)?\s*(primary\s*key)?)|((not\s*null)?\s*(default\s*(`.

Re: [PHP] REGEX: grouping of alternative patterns [SOLVED]

2007-10-30 Thread Stijn Verholen
Robin Vickery schreef: [snip] Because each of your subpatterns can match an empty string, the lefthand subpattern always matches and the righthand subpattern might as well not be there. Indeed they do, i did not realise that. The simplest solution, if you don't want to completely rethink

Re: [PHP] Regex for Advanced search feature

2007-10-19 Thread Robert Cummings
On Fri, 2007-10-19 at 09:48 -0700, Kevin Murphy wrote: I'm trying to create an advanced search feature for my site, and I have it mostly working the way I want. I take whatever search term ($searchkey) that the user submits, explodes if off any spaces between words, and then use that to

[PHP] Regex for Advanced search feature

2007-10-19 Thread Kevin Murphy
I'm trying to create an advanced search feature for my site, and I have it mostly working the way I want. I take whatever search term ($searchkey) that the user submits, explodes if off any spaces between words, and then use that to search for each word separately. $keys = explode(

Re: [PHP] Regex æøå email validation?

2007-09-25 Thread Per Jessen
Søren Neigaard wrote: It works fine, but my friend strangely enough has users with special danish letters (æøåÆØÅ) in their email address, and that it does not accept. Hej Søren I just realised - you can't have those characters in the email address. You may have them in the name part, but

[PHP] Regex æøå email validation?

2007-09-24 Thread Søren Neigaard
Hi guys Im helping a friend with hes internet site, and I have found this regex email validation regex on the internet: var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a- z]{2,6}(?:\.[a-z]{2})?)$/i; if(!filter.test(email)) { return false; } It works fine, but my

<    1   2   3   4   5   6   7   8   >