Re: [PHP] Re: Regular Expression to get the whole Comma Separated String in Array Key

2010-07-01 Thread Richard Quadling
On 1 July 2010 06:47, Gaurav Kumar kumargauravjuke...@gmail.com wrote: Hey Richard, Thanks!!! You have resolved my problem.. GK On Wed, Jun 30, 2010 at 7:42 PM, Gaurav Kumar kumargauravjuke...@gmail.comwrote: Hi All, Need help in resolving the below problem- I would like to get the

[PHP] Re: Regular Expression to get the whole Comma Separated String in Array Key

2010-06-30 Thread Jo�o C�ndido de Souza Neto
Not tested, but I think it should work: preg_match_all('/(\d+),/', $postText, $matches); -- João Cândido de Souza Neto Gaurav Kumar kumargauravjuke...@gmail.com escreveu na mensagem news:aanlktikdb_ismnkpomicxzsfzixg4dedznunrcimj...@mail.gmail.com... Hi All, Need help in resolving the

[PHP] Re: Regular Expression to get the whole Comma Separated String in Array Key

2010-06-30 Thread Gaurav Kumar
Hey Richard, Thanks!!! You have resolved my problem.. GK On Wed, Jun 30, 2010 at 7:42 PM, Gaurav Kumar kumargauravjuke...@gmail.comwrote: Hi All, Need help in resolving the below problem- I would like to get the whole comma separated string into an array value- 1. $postText = chapters

Re: [PHP] Re: Regular Expression Backreference in subpattern.

2008-09-28 Thread Nathan Rixham
Shiplu wrote: Sorry The previous code was wrong, Its the correct version, $x = a b;c d;e f;; preg_match('/(?Pkeys\w) (?Pvalues\w)/',$x,$m); print_r($m); Now I am using backrefrence \1 in in ?P option like (?P\1\d+). and I got the error. thought I best update for courtesy sake; I spent a

[PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Nathan Rixham
Shiplu wrote: The string is tdcharge/tdtd100/td. I want and array( charge=100). I am using this regular expression, '/td([^]+)\/tdtd(?P\1\d+)\/td/'. But its not working.. I get this error., PHP Warning: preg_match(): Compilation failed: syntax error after (?P at offset 25 in

[PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Al
What's the complete row? e.g., trtdcharge/tdtd100/td/tr Or, are there other td cells in the row? Shiplu wrote: The string is tdcharge/tdtd100/td. I want and array( charge=100). I am using this regular expression, '/td([^]+)\/tdtd(?P\1\d+)\/td/'. But its not working.. I get this error., PHP

Re: [PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Shiplu
On 9/27/08, Nathan Rixham [EMAIL PROTECTED] wrote: Shiplu wrote: The string is tdcharge/tdtd100/td. I want and array( charge=100). I am using this regular expression, '/td([^]+)\/tdtd(?P\1\d+)\/td/'. But its not working.. I get this error., PHP Warning: preg_match():

Re: [PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Shiplu
On 9/27/08, Al [EMAIL PROTECTED] wrote: What's the complete row? e.g., trtdcharge/tdtd100/td/tr Or, are there other td cells in the row? No TD cells. forget the real world problem. I made the exact replica of that. I need the sample work. -- Blog: http://talk.cmyweb.net/ Follow me:

[PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Al
Shiplu wrote: The string is tdcharge/tdtd100/td. I want and array( charge=100). I am using this regular expression, '/td([^]+)\/tdtd(?P\1\d+)\/td/'. But its not working.. I get this error., PHP Warning: preg_match(): Compilation failed: syntax error after (?P at offset 25 in

[PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Nathan Rixham
Shiplu wrote: The string is tdcharge/tdtd100/td. I want and array( charge=100). I am using this regular expression, '/td([^]+)\/tdtd(?P\1\d+)\/td/'. But its not working.. I get this error., PHP Warning: preg_match(): Compilation failed: syntax error after (?P at offset 25 in

Re: [PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Shiplu
On 9/27/08, Nathan Rixham [EMAIL PROTECTED] wrote: Shiplu wrote: The string is tdcharge/tdtd100/td. I want and array( charge=100). I am using this regular expression, '/td([^]+)\/tdtd(?P\1\d+)\/td/'. But its not working.. I get this error., PHP Warning: preg_match():

Re: [PHP] Re: Regular Expression Backreference in subpattern.

2008-09-27 Thread Shiplu
Sorry The previous code was wrong, Its the correct version, $x = a b;c d;e f;; preg_match('/(?Pkeys\w) (?Pvalues\w)/',$x,$m); print_r($m); Now I am using backrefrence \1 in in ?P option like (?P\1\d+). and I got the error. -- Blog: http://talk.cmyweb.net/ Follow me: http://twitter.com/shiplu

[PHP] Re: Regular Expression just one step away from what I need....

2007-08-17 Thread M. Sokolewicz
Jay Blanchard wrote: Given the string 'foo''bar''glorp' (all quotes are single quotes)I had hoped to find a regular expression using preg_match that would return an array containing just those words without having to go through additional gyrations, like exploding a string to get an array. I

[PHP] Re: regular expression help!

2007-01-18 Thread Al
First stripslashes() and all newlines [\n\r*]. It makes the regex much easier. $pattern= %img\x20[\w\d\=\x20]+(src=\x20*\)([/\w\d\.]+)[\\x20]*/%i; preg_match($pattern, $string, $match); If more than one in the string, use preg_match_all(). Now print_r($match); so you can see the result.

[PHP] Re: Regular expression to find from start of string to first space

2006-08-08 Thread Barry
Dave M G schrieb: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I *think*

[PHP] Re: Regular expression to find from start of string to first space

2006-08-08 Thread Adam Zey
Dave M G wrote: PHP, Shouldn't this regular expression select everything from the start of the string to the first space character: $firstWord = preg_match('#^*(.*) #iU', $word); It doesn't, so clearly I'm wrong, but here's why I thought it would: The enclosing has marks, #, I *think* just

[PHP] Re: regular expression to extract from the middle of a string

2006-07-14 Thread Al
Steve Turnbull wrote: Hey folks I don't want to just get you to do the work, but I have so far tried in vain to achieve something... I have a string similar to the following; cn=emailadmin,ou=services,dc=domain,dc=net I want to extract whatever falls between the 'cn=' and the following comma

[PHP] Re: regular expression to extract from the middle of a string

2006-07-14 Thread Adam Zey
Steve Turnbull wrote: Hey folks I don't want to just get you to do the work, but I have so far tried in vain to achieve something... I have a string similar to the following; cn=emailadmin,ou=services,dc=domain,dc=net I want to extract whatever falls between the 'cn=' and the following comma

[PHP] Re: Regular expression

2006-01-30 Thread Al
Barry wrote: Simple reg help please i want to match the last , in a,b,c,d and replace it with and i tried ereg_replace(,([a-zA-z])*$, and ,$string); but i forgot how to add the d which is also matched now back to the and Can you give any good reg_exp sites where to learn it? Its long ago

[PHP] Re: regular expression for time

2005-08-29 Thread Al
babu wrote: HI, how can i write regular expression for time in 24-hour format i:e, HH:MM:SS. using preg_match. thanks babu - How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos

[PHP] Re: Regular expression question

2005-08-11 Thread TalkativeDoggy
How about using the lower() function? Leon Vismer wrote: Hi I would like to convert from one naming convention within a sql statement to another. I have the following, code $str = insert into userComment (userID, userName, userSurname) values (0, 'Leon', 'Vismer'); $match = array(

[PHP] Re: regular expression help

2005-01-21 Thread Jason
Jason wrote: Simple functions to check fix if necessary invalid formating of a MAC address... I seem to be having problems with the global variable $mac not being returned from the fix_mac() function. Any help is appreciated. ?php /* * ex. 00:AA:11:BB:22:CC */ function chk_mac( $mac ) {

Re: [PHP] Re: regular expression help

2005-01-21 Thread RaTT
Hi, From what i can see you dont even need to call global, as your passing variables to the function ? this could be causing the script to confuse itself. hth On Fri, 21 Jan 2005 09:30:21 -0700, Jason [EMAIL PROTECTED] wrote: Jason wrote: Simple functions to check fix if necessary invalid

[PHP] Re: regular expression help

2005-01-21 Thread Jason
You were right, I removed the reference to global $mac and it started working great. Thanks. It seems sometimes another set of eyes to catch stuff really helps... thanks. Jason wrote: Jason wrote: Simple functions to check fix if necessary invalid formating of a MAC address... I seem to be

[PHP] Re: Regular Expression

2004-11-25 Thread Ing. Ivo F.A.C. Fokkema
On Wed, 24 Nov 2004 13:17:48 -0500, Ankur Os wrote: Hi, This is quite simpal problem that i want to made regular expression which can read this kind of structure... a,b,c not like this 1. ,a,a,a 2. a,,,aa,, 3. a,a,a,,, means simpal structure with comma (a,b,c...) Hi, Try

[PHP] Re: Regular expression

2004-06-30 Thread Aidan Lister
I suggest not using a regex. There are better tools for parsing an email, for example formail. $email = `formail -x Return-Path`; See google.com for more information Regards, Aidan Syed Ghouse [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All will anyone give me a solution to

[PHP] Re: Regular expression

2004-06-30 Thread Red Wingate
If you still like to gather the information without using any tools: $email = explode( \n , $mailText ); foreach ( $email AS $emailLine ) { $emailLine = trim( $emailLine ); if ( strtoupper ( substr( $emailLine , 0 , 4 ) ) == 'FROM' ) { preg_match( '#^from\s*:\s*([^]+)(([^]+))?#si'

Fw: [PHP] Re: Regular expression

2004-06-30 Thread Syed Ghouse
- Original Message - From: Syed Ghouse [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 30, 2004 PM 04:43 Subject: Re: [PHP] Re: Regular expression Thanks Aiden for ur help i used ur code and i got name as Red Wingate[EMAIL PROTECTED] and no email. So pls correct

Re: Fw: [PHP] Re: Regular expression

2004-06-30 Thread Red Wingate
First of all check who u credit :p Secondly why don't you just try to fix it yourself? There was just a typo in the regexp: - #^from\s*:\s*([^]+)(([^]+))?#si + #^from\s*:\s*([^]+)(([^]+))?#si Hopefully this will help you even more: ?php /** * @param string $runlevel * @return mixed */

Fw: [PHP] Re: Regular expression

2004-06-30 Thread Syed Ghouse
Yeah i used ur coding below and i got the solution for my problem. Thanks Aidan Syed - Original Message - From: Syed Ghouse [EMAIL PROTECTED] To: php mailinglists [EMAIL PROTECTED] Sent: Wednesday, June 30, 2004 PM 04:45 Subject: Fw: [PHP] Re: Regular expression - Original

Re: Fw: [PHP] Re: Regular expression

2004-06-30 Thread Curt Zirzow
* Thus wrote Red Wingate: First of all check who u credit :p Secondly why don't you just try to fix it yourself? There was just a typo in the regexp: - #^from\s*:\s*([^]+)(([^]+))?#si + #^from\s*:\s*([^]+)(([^]+))?#si Hopefully this will help you even more: You're too nice.. Btw, I

Re: Fw: [PHP] Re: Regular expression

2004-06-30 Thread Red Wingate
Oh ... you forgot to include your account-info so i won't be able to send you the money :-/ [...] You're too nice.. Btw, I need some money. Send me money ASAP. It must be an amount greater than $200, and be delivered to me directly, thank you. [...] -- PHP General Mailing List

[PHP] Re: Regular expression question

2004-05-27 Thread Jason Barnett
This should work: ^\\ # Don't match if a backslash precedes \[ # Open bracket ([^\]]+?) # Text, including whitespace \] # Close bracket By the way, using a tool called The Regex Coach I solved your problem in about 10 seconds. For those having regex problems you might

[PHP] Re: Regular Expression

2004-05-05 Thread Tumurbaatar S.
Because the substrings can contain any char-s including commas. Also I use reg exp not for splitting only but for validating whether whole string and the substrings are correctly formatted. Using reg exp requires much less coding than traditional programming. Why not just strip out the braces

[PHP] Re: Regular Expression

2004-05-04 Thread Tumurbaatar S.
Forgot about curly brackets. The above example is: /^\{(?:(pattern),)*|(pattern)?\}$/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Regular Expression

2004-05-04 Thread Paul Chvostek
On Wed, May 05, 2004 at 02:26:25PM +0900, Tumurbaatar S. wrote: There's an input string like {str1,str2,...,strN}. I want to capture all these strings and due to complexity of them I use a preg_match_all() instead of simple split. A pattern for the matching strings is ready but I cannot

[PHP] Re: Regular expression checker

2004-03-17 Thread Luis Mirabal
an excelent tool: The Regex Coach, its free and you can grab it from http://weitz.de/regex-coach/ and its available for windows and linux! luis. [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Hello all, For a while I tried in vain to find a decent regular expression tester.

[PHP] Re: Regular expression help?

2004-02-02 Thread Matthew Weier O'Phinney
* Jas [EMAIL PROTECTED]: Not sure if anyone knows of a good way to match strings of this type... 00:02:8b:0c:2f:09 I have tried this but its not working.

[PHP] Re: Regular Expression

2003-07-08 Thread SLanger
Hello If you simply want to check if the fields contains Po BOX simply use the stripos function or one of the other string functions. They should be faster than reg ex. If you still want to use reg ex I suggest using preg_match since it is faster than ereg. About your regex: It will not find

[PHP] Re: Regular Expression Help in my PHP! Sorry if wrong group

2003-01-15 Thread Jason Lehman
I figured out what I was doing wrong. My regexp should of looked like this /a[^]*(Tampa)\/a/ and that made it more specific and kept it to that match. Jason Lehman wrote: I have a script that turns certain words into links. That I am having no problems with, it is when I want to turn the

[PHP] Re: regular expression

2002-10-15 Thread Ns_Andy
perl: preg_match '/a\s*href/s*=/s*[\']?[^\']+[\']?/i' or eregi 'a[ ]*href[ ]*=[ ]*[\']?[^\']+[\']?' -- Regards, Noodle Snacks [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... what would be a simple regular expression for a href=anythinghere? for future

[PHP] Re: regular expression

2002-10-15 Thread Noodle Snacks
Thanks. Ns_andy [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... perl: preg_match '/a\s*href/s*=/s*[\']?[^\']+[\']?/i' or eregi 'a[ ]*href[ ]*=[ ]*[\']?[^\']+[\']?' -- Regards, Noodle Snacks [EMAIL PROTECTED] wrote in message [EMAIL

[PHP] Re: Regular expression question

2002-08-30 Thread Philip Hallstrom
$str = jeD1GLal; $str = ereg_replace([1LIO0lio], , $str); something like that... On Fri, 30 Aug 2002, Jeff Lewis wrote: Is there a regular expression that will remove 1, L, I, O, 0 and the lowercase equivilants from a varialbe? I am not horribly well versed in regular expressions...so I'm

[PHP] Re: Regular expression for correcting proper nouns

2002-07-17 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Henry) wrote: I'm looking for a simple was to correct a list of proper nouns given all in lower case! For example given $string=london paris rome; I would like London Paris Rome. However there is one cavet; if the word already has a

[PHP] Re: Regular Expression

2002-01-02 Thread Joe Webster
preg_match(/body\s([^]*)/i, $html, $args); $body_props = $args[1]; preg is much faster/better than ereg. note the /i at the end of the preg, that makes it case insative, drop the i if you want it to be case sensative on the match. -Joe John Monfort [EMAIL PROTECTED] wrote in message [EMAIL

[PHP] Re: Regular Expression

2001-11-13 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Adam Whitehead) wrote: if ((ereg([^[:alnum:]],$fn)) || (ereg([^[:alnum:]],$sn))) { // Do something here } What it's doing is checking two variables to make sure they contain only alphanumeric characters. I have a requirement that

[PHP] Re: regular expression

2001-11-01 Thread liljim
Hello, Galkov Vladimir [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Need to remove all ../ /.. from user inputing string to prevent him walking and creating filesdirectories where I don't whant see them/him... The string: $path =

[PHP] Re: regular expression

2001-11-01 Thread liljim
Whooops, Pasted wrong line. This should do it: $string = preg_replace(/(\.*\/)+(.*?\.*\/)?/s, , $string); James -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list

[PHP] Re: regular expression

2001-11-01 Thread liljim
Whooops, Pasted wrong line. This should do it: $string = preg_replace(/(\.*\/)+(.*?\.*\/)?/s, , $string); Gah... Not.. enough... caffeine: Modification: $string = preg_replace(/(\.*\/)+(.*?\.*\/)?(\.*)?/s, , $string); -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] Re: regular expression help

2001-09-18 Thread _lallous
This should do (but ofcourse you might want to play a bit with it) $mem = ' A HREF=http://www.mydomain.com/mypage.php;something/a is fine A HREF=http://www.yourdomain.com/yourpage.php;something/a is wrong A HREF=http://www.yourdomain.com/yourpage.php;something/a is finebr a

[PHP] Re: Regular Expression ? from newbie

2001-09-12 Thread _lallous
here's your PHP code, ? $mem = ' table cellspacing=2 cellpadding=2 border=1 tr td align=centerbanana/td td align=left.46/td td align=right.55/td /tr tr td align=centerpear/td td align=left.38/td td align=right.51/td /tr tr td align=centerapple/td td

[PHP] Re: Regular Expression Problem and PHP 4 (urgent)

2001-08-15 Thread Ross Nielsen
Actually I didn't pose my question correctly. I also needed to grep out the Link for use in JS during the process. I wrapped this in a class file and here is the entry that I ended up with. Thanks for the assist though... == function

[PHP] Re: Regular Expression Problem and PHP 4 (urgent)

2001-08-14 Thread Richard Lynch
blah blah blah blah blah Link blah blah blah blah Link I think I need to use eregi_replace to make the line look like this: blah blah blah blah blah a href='#'Link/a blah blah blah blah a href='#'Link/a Depending on how accurately you have stated the problem, this may work: $text = 'blah

Re: [PHP] Re: Regular Expression help

2001-06-30 Thread J Smith
Clayton Dukes wrote: Okay, here's what I have so far: ---snip--- if ((!$email) || ($email==) || (!eregi(^[_\.0-9a-z-]+@domain.+[a-z],$email)) ) $stop = center._ERRORINVEMAIL./centerbr; ---snip--- This works, but how can I add a second domain? ie: Try:

Re: [PHP] Re: Regular Expression help

2001-06-30 Thread Brad Hubbard
On Fri, 29 Jun 2001 23:43, Clayton Dukes wrote: Okay, here's what I have so far: ---snip--- if ((!$email) || ($email==) || (!eregi(^[_\.0-9a-z-]+@domain.+[a-z],$email)) ) $stop = center._ERRORINVEMAIL./centerbr; ---snip--- This works, but how can I add a

[PHP] Re: Regular Expression help

2001-06-29 Thread Clayton Dukes
Okay, here's what I have so far: ---snip--- if ((!$email) || ($email==) || (!eregi(^[_\.0-9a-z-]+@domain.+[a-z],$email)) ) $stop = center._ERRORINVEMAIL./centerbr; ---snip--- This works, but how can I add a second domain? ie: ---snip--- if ((!$email) ||