Re: [PHP] Regex nightmares

2005-05-24 Thread Richard Lynch
On Mon, May 23, 2005 8:43 am, W Luke said: > I really struggle with regex, and would appreciate some guidance. > Basically, I have a whole load of files (HTML) which are updated every > few minutes. I need to go through each line, looking for the word > CONFIRMED: (which is always in capitals, and

RE: [PHP] Regex nightmares

2005-05-24 Thread Murray @ PlanetThoughtful
> [Course, when you *DO* need RegEx it's *more* than a bit of a headache. > More like a migraine :-)] One of these days I will truly master regular expressions. After that, enlightenment should be easy. Regards, Murray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: ht

Re: [PHP] Regex help

2005-06-06 Thread Philip Hallstrom
I am currently creating a once off text parser for a rather large document that i need to strip out bits of information on certain lines. The line looks something like : "Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221 Website: http://www.urlhere.com E-Mail: [EMAIL PROTECT

Re: [PHP] Regex Help

2003-02-11 Thread Ernest E Vogelsinger
At 07:47 11.02.2003, Lord Loh. said: [snip] >I am new to regex and broke my head on it the other day...in vain... > >Can any one tell me a place to get a step by step tutorial on it or help me >out on how to work it out ? http://www.php.net/manual/en/ref.pcr

Re: [PHP] Regex Help

2003-02-11 Thread Chris Hayes
At 07:47 11-2-2003, you wrote: I am new to regex and broke my head on it the other day...in vain... Can any one tell me a place to get a step by step tutorial on it or help me out on how to work it out ? Some tutorials: http://codewalkers.com/tutorials/30/3/ Codewalkers - Using PCRE http://sam

Re: [PHP] Regex Help

2003-02-11 Thread Kevin Waterson
This one time, at band camp, "Lord Loh." <[EMAIL PROTECTED]> wrote: > I am trying to make a link collector. > > after opening the desired page, I want to get all the hyperlinks on it... OK, this is quick and nasty, but you can add sanity/error checking etc as you please, but it shows you the con

Re: [PHP] regex problem

2003-03-13 Thread CPT John W. Holmes
> suppose there's a string > $string="I like my(hot) coffee with sugar and (milk)(PHP)"; > > I would like to get an output of all possible combinations of the sentence > with the words between brackets: > eg. > I like my hot coffee with sugar and > I like my hot coffee with sugar and milk > I like

Re: [PHP] regex help?

2003-07-21 Thread David Nicholson
Hello, This is a reply to an e-mail that you wrote on Mon, 21 Jul 2003 at 08:59, lines prefixed by '>' were originally written by you. > Can't seem to get this to work... > trying to yank stuff xxx from > xxx Try this: preg_match("/]*>(.*)/i", $l, $regs); HTH David. -- phpmachine :: The quick

RE: [PHP] regex problem

2003-08-15 Thread Ford, Mike [LSS]
On 15 August 2003 12:02, Merlin wrote: > Hi there, > > I have a regex problem. > > Basicly I do not want to match: > > /dir/test/contact.html > > But I do want to match: > /test/contact.html > > I tryed this one: > ^[!dir]/(.*)/contact(.*).html$ Well, that's not going to work because the con

RE: [PHP] regex problem

2003-03-16 Thread John W. Holmes
> suppose there's a string > $string="I like my(hot) coffee with sugar and (milk)(PHP)"; > > I would like to get an output of all possible combinations of the sentence > with the words between brackets: > eg. > I like my hot coffee with sugar and > I like my hot coffee with sugar and milk > I like

Re: [PHP] regex problem

2003-06-01 Thread Jim Lucas
Are you wanting the $_POST['nums1'] to have only numbers, -, ., #, : Is this what you are trying to match. if so, try this. if ( preg_match("/[^0-9\#\:\.\-]/", $_POST['nums1']) ) { throw error() } This will match anything that is not a number or one of the other special chars that are in

Re: [PHP] regex problem

2003-06-01 Thread Daniel J. Rychlik
D]>; <[EMAIL PROTECTED]> Sent: Saturday, May 31, 2003 6:04 PM Subject: Re: [PHP] regex problem > Are you wanting the $_POST['nums1'] to have only numbers, -, ., #, : > > Is this what you are trying to match. if so, try this. > > if ( preg_match("/[^0-9\#\:\.\

Re: [PHP] REGEX Question

2003-06-17 Thread Marek Kilimajer
. matches any character except newline by default, use s modifier: preg_match("/(.*)/s", $data, $Match) Ron Dyck wrote: I need to match text between two html comment tags. I'm using: preg_match("/(.*)/", $data, $Match) Which work fine until I have carriage returns. The following doesn't match:

Re: [PHP] REGEX Question

2003-06-18 Thread Don Read
On 17-Jun-2003 Ron Dyck wrote: > I need to match text between two html comment tags. > > I'm using: preg_match("/(.*)/", $data, > $Match) > > Which work fine until I have carriage returns. The following doesn't > match: > Use the m (multiline) modifier: preg_match("/(.*)/m", ... Regards, --

Re: [PHP] REGEX Question

2003-06-18 Thread SLanger
Hello Two things: First wouldn't it be faster to use strpos and substr if you simply have to find the literate and . Second: If you use your regex and you have something like " This is some text to grasp this is text I don't want This is some other text I want" The result would be " This is so

Re: [PHP] RegEx -- help

2003-10-10 Thread Mohamed Lrhazi
Untested: function fixhisnumber($str){ //remove all but numbers $str = preg_replace("/[^0-9]/","",$str); //append 1, unless it's already there $str = $str[0] == '1'? $str:"1".$str; if (strlen($str) == 10) return $str; else return -1; } Mohamed~ On Fri, 2003-10-10 at 14:01, Lists wrote: > I

RE: [PHP] Regex help

2004-03-15 Thread Chris W. Parker
Ryan A on Monday, March 15, 2004 9:07 AM said: > I know this is pretty easy to do but I am horrorable at working with > regular expressions and was wondering if anybody might take a min to > help please. in that case you should get the regex coach (easy to find via

Re: [PHP] Regex help

2004-03-15 Thread Jason Wong
On Tuesday 16 March 2004 01:06, Ryan A wrote: > I know this is pretty easy to do but I am horrorable at working with > regular expressions and was wondering if anybody might take a min to help > please. > > I will have a variable: $the_extention > which will have a value like:98797-234234--2

Re: [PHP] Regex help

2004-03-15 Thread Michal Migurski
>I will have a variable: $the_extention which will have a value like: >98797-234234--2c-something-2c > >How do I take out the part which will always start with "--2c" and will >always end with "-2c" You could use preg_replaces, like so: $result = preg_replace('/--2c.+-c/', '', $the_extent

Re: [PHP] Regex help

2004-03-15 Thread Eric Gorr
At 6:06 PM +0100 3/15/04, Ryan A wrote: I know this is pretty easy to do but I am horrorable at working with regular expressions and was wondering if anybody might take a min to help please. I will have a variable: $the_extention which will have a value like:98797-234234--2c-something-2c How

RE: [PHP] Regex help

2004-03-15 Thread Ryan A
Hey, Thanks guys. I did search on google first for a tutorial, problem is with something as widely used as regular expressions there are LOTS of results...I felt it would be better to ask if anyone has a favourite.. ie: if you learnt it off the web and not via the manual. The last time I had this

Re: [PHP] Regex help

2004-03-15 Thread trlists
On 15 Mar 2004 Eric Gorr wrote: > >which will have a value like:98797-234234--2c-something-2c > > > >How do I take out the part which will always start with "--2c" and will > >always end with "-2c" > > I'd be interested in the answer to this question as well. > Seems like it should be easy.

Re: [PHP] regex issue

2004-11-30 Thread Greg Donald
On Tue, 30 Nov 2004 17:18:33 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > All I want to do is capture the keyword (array, break, echo, etc) and color > it. I'd do it like this: $source = 'this is a line of text'; $term = 'line'; $text = eregi_replace("($term)", "\\1", $source); -- Gre

RE: [PHP] regex issue

2004-11-30 Thread nate
Tuesday, November 30, 2004 5:36 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] regex issue On Tue, 30 Nov 2004 17:18:33 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > All I want to do is capture the keyword (array, break, echo, etc) and color > it. I'd do it like this: $

Re: [PHP] regex issue

2004-11-30 Thread Rick Fletcher
[EMAIL PROTECTED] wrote: All I want to do is capture the keyword (array, break, echo, etc) and color it. $txt = "this is an array('test')"; $pattern = "/(array|break|echo|continue)([\(.|\s.|\;.])/"; echo preg_replace($pattern, '$0', $txt); This captures "array(" though and I just want "array". Th

Re: [PHP] regex help

2005-01-13 Thread Jochem Maas
Jason Morehouse wrote: Hello, I normally can take a bit of regex fun, but not this time. Simple enough, in theory... I need to match (count) all of the bold tags in a string, including ones with embedded styles (or whatever else can go in there). and . My attempts keep matching as well. okay

Re: [PHP] regex help

2005-01-14 Thread Robin Vickery
On Thu, 13 Jan 2005 16:06:32 -0500, Jason Morehouse <[EMAIL PROTECTED]> wrote: > Hello, > > I normally can take a bit of regex fun, but not this time. > > Simple enough, in theory... I need to match (count) all of the bold tags > in a string, including ones with embedded styles (or whatever else

RE: [PHP] regex help

2005-01-14 Thread Ford, Mike
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm > -Original Message- > From: Jason Morehouse > Sent: 13/01/05 21:06 > > I normally can take a bit of regex fun, but not this time. > > Simple enough, in theory... I need to

RE: [PHP] regex help

2005-01-14 Thread Robinson, Matthew
Do you have the example regex so far? I'd suggest maybe mailto:[EMAIL PROTECTED] Sent: 13 January 2005 21:07 To: php-general@lists.php.net Subject: [PHP] regex help Hello, I normally can take a bit of regex fun, but not this time. Simple enough, in theory... I need to match (count) all of the

Re: [PHP] regex help

2005-01-14 Thread Jason Wong
On Friday 14 January 2005 05:06, Jason Morehouse wrote: > Simple enough, in theory... I need to match (count) all of the bold tags > in a string, including ones with embedded styles (or whatever else can > go in there). and . My attempts keep matching > as well. Quick-n-dirty: preg_match_a

Re: [PHP] regex help

2005-01-14 Thread Richard Lynch
Jason Morehouse wrote: > Simple enough, in theory... I need to match (count) all of the bold tags > in a string, including ones with embedded styles (or whatever else can > go in there). and . My attempts keep matching > as well. I think something not unlike: '/|>)/' The point being that you

Re: [PHP] regex help

2005-01-14 Thread Bret Hughes
On Thu, 2005-01-13 at 15:06, Jason Morehouse wrote: > Hello, > > I normally can take a bit of regex fun, but not this time. > > Simple enough, in theory... I need to match (count) all of the bold tags > in a string, including ones with embedded styles (or whatever else can > go in there). and

Re: [PHP] regex help

2005-01-15 Thread Jason Morehouse
Mike Ford wrote: Just off the top of my head (and untested!), I'd try something like /]*)?>/ Cheers! Mike That pretty much seems to work the best. Thanks all! -- Jason Morehouse Vendorama - Create your own online store http://www.vendorama.com -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Regex help

2005-01-28 Thread trlists
On 28 Jan 2005 [EMAIL PROTECTED] wrote: > I need a validation regex that will "pass" a string. The string can be no > longer than some maximum length, and it can contain any characters except > two consecutive ampersands (&) anywhere in the string. This is an example of something that is easier

Re: [PHP] Regex help

2005-01-28 Thread kjohnson
[EMAIL PROTECTED] wrote on 01/28/2005 03:19:14 PM: > On 28 Jan 2005 [EMAIL PROTECTED] wrote: > > > I need a validation regex that will "pass" a string. The string can be no > > longer than some maximum length, and it can contain any characters except > > two consecutive ampersands (&) anywher

Re: [PHP] Regex help

2005-01-28 Thread Richard Lynch
[EMAIL PROTECTED] wrote: > OK, this is off-topic like every other "regex help" post, but I know some > of you enjoy these puzzles :) > > I need a validation regex that will "pass" a string. The string can be no > longer than some maximum length, and it can contain any characters except > two consec

Re: [PHP] Regex help

2005-01-28 Thread Richard Lynch
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote on 01/28/2005 03:19:14 PM: > >> On 28 Jan 2005 [EMAIL PROTECTED] wrote: >> >> > I need a validation regex that will "pass" a string. The string can be > no >> > longer than some maximum length, and it can contain any characters > except >> > two co

Re: [PHP] Regex help

2005-01-28 Thread trlists
On 28 Jan 2005 [EMAIL PROTECTED] wrote: > Thanks, Tom. I agree, but not an option at this time - other parts of the > design require this to be a regex. It is pretty easy to do with two regexps, one to check the length and another to see if there is a double &. Would that work? I don't know

Re: [PHP] Regex help

2005-01-28 Thread kjohnson
[EMAIL PROTECTED] wrote on 01/28/2005 04:13:38 PM: > On 28 Jan 2005 [EMAIL PROTECTED] wrote: > > > Thanks, Tom. I agree, but not an option at this time - other parts of the > > design require this to be a regex. > > It is pretty easy to do with two regexps, one to check the length and > anoth

RE: [PHP] Regex help

2005-01-29 Thread Michael Sims
[EMAIL PROTECTED] wrote: > OK, this is off-topic like every other "regex help" post, but I know > some of you enjoy these puzzles :) This isn't an exam question, is it? ;) > I need a validation regex that will "pass" a string. The string can > be no longer than some maximum length, and it can con

RE: [PHP] Regex help

2005-01-29 Thread Bret Hughes
On Sat, 2005-01-29 at 08:58, Michael Sims wrote: > [EMAIL PROTECTED] wrote: > > OK, this is off-topic like every other "regex help" post, but I know > > some of you enjoy these puzzles :) > > This isn't an exam question, is it? ;) > > > I need a validation regex that will "pass" a string. The str

RE: [PHP] Regex help

2005-01-29 Thread Michael Sims
Bret Hughes wrote: > On Sat, 2005-01-29 at 08:58, Michael Sims wrote: >> [EMAIL PROTECTED] wrote: >>> I need a validation regex that will "pass" a string. The string can >>> be no longer than some maximum length, and it can contain any >>> characters except two consecutive ampersands (&) anywhere i

Re: [PHP] Regex help

2005-01-29 Thread kjohnson
Michael Sims wrote: >> I need a validation regex that will "pass" a string. The string can >> be no longer than some maximum length, and it can contain any >> characters except two consecutive ampersands (&) anywhere in the >> string. >Yup, use this perl regex: > > /^(?:(&)(?!&)|[^&]){1,5}$/

Re: [PHP] regex help

2004-08-01 Thread Jim Grill
Can you post a little sample of the data and your current code? thanks. Jim Grill Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Kathleen Ballard" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 01, 2004 8:27 AM Subject: [PHP] regex help > I am

Re: [PHP] regex help

2004-08-01 Thread Justin Patrin
On Sun, 1 Aug 2004 06:27:51 -0700 (PDT), Kathleen Ballard <[EMAIL PROTECTED]> wrote: > I am at the tailend of a project that involves moving > legacy data from one dbms to another. The client has > added a new requirement to the data manipulation that > is required. I need to remove all tags (the

Re: [PHP] regex help

2004-08-01 Thread Justin Patrin
Forget my first attempt, using the e modifier and another preg_replace is much better. $return = preg_replace('!(.*?)!ie', 'preg_replace("!]*>!i", "", "$1")', $originalText); On Sun, 1 Aug 2004 13:39:49 -0700, Justin Patrin <[EMAIL PROTECTED]> wrote: > On Sun, 1 Aug 2004 06:27:51 -0700 (PDT), Kat

Re: [PHP] Regex Help

2004-05-10 Thread Curt Zirzow
* Thus wrote hitek ([EMAIL PROTECTED]): > Greetings list, > > I have been given a list of products, and I need some help building a > regular expression to split the category from the sub category. > Example: > CamerasDigital_CannonXLRshot <-Original entry in list > Cameras Digital Cannon XLRshot

Re: [PHP] Regex Help

2004-05-10 Thread hitek
Curt, That's perfect. Works like a charm. Thanks, Keith At 03:54 PM 5/10/2004, Curt Zirzow wrote: * Thus wrote hitek ([EMAIL PROTECTED]): > Greetings list, > > I have been given a list of products, and I need some help building a > regular expression to split the category from the sub category. > E

Re: [PHP] regex problem

2004-07-01 Thread Justin Patrin
On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close <[EMAIL PROTECTED]> wrote: > > I'm trying to get a simple regex to work. Here is the test script I have. > > #!/usr/bin/php -q > > $string = "hello\nworld\n"; > $string = preg_replace("/[^\r]\n/i","\r\n",$string); $string = preg_replace("/([^\r])\n

Re: [PHP] regex problem

2004-07-01 Thread Josh Close
Why is it taking the char before the [^\r] also? -Josh On Thu, 1 Jul 2004 15:17:04 -0700, Justin Patrin <[EMAIL PROTECTED]> wrote: > > On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close <[EMAIL PROTECTED]> wrote: > > > > I'm trying to get a simple regex to work. Here is the test script I have. > > >

Re: [PHP] regex problem

2004-07-01 Thread Curt Zirzow
* Thus wrote Justin Patrin: > On Thu, 1 Jul 2004 16:41:50 -0500, Josh Close <[EMAIL PROTECTED]> wrote: > > > > I'm trying to get a simple regex to work. Here is the test script I have. > > > > #!/usr/bin/php -q > > > > > $string = "hello\nworld\n"; > > $string = preg_replace("/[^\r]\n/i","\r\n"

Re: [PHP] Regex help needed...

2001-02-12 Thread Jason Stechschulte
On Mon, Feb 12, 2001 at 12:15:04PM -0500, Jesse Swensen wrote: > This should be a quick one, but I can't seem to wrap my brain around it. > All I need to do is replace leading or trailing spaces with underscores. If > there is spaces in between words, leave them alone. $fix = ereg_replace("(^ )|

RE: [PHP] Regex help needed...

2001-02-12 Thread PHPBeginner.com
rtrim() www.php.net/rtrim Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Jesse Swensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 13, 2001 2:15 AM To: [EMAIL PROTECT

Re: [PHP] Regex help needed...

2001-02-12 Thread Jesse Swensen
on 2/12/01 1:01 PM, Jason Stechschulte at [EMAIL PROTECTED] wrote: > On Mon, Feb 12, 2001 at 12:15:04PM -0500, Jesse Swensen wrote: >> This should be a quick one, but I can't seem to wrap my brain around it. >> All I need to do is replace leading or trailing spaces with underscores. If >> there

Re: [PHP] Regex help needed...

2001-02-12 Thread Jason Stechschulte
> This is very close. If the string, " Testing ", had multiple spaces, but > I wanted to convert each space to a "_", then what? I tried: There may be a better way, but here is a lengthy one that works. $checkme = " this is it "; if(ereg("^( )+", $checkme

Re: [PHP] Regex help needed...

2001-02-12 Thread Christian Reiniger
On Monday 12 February 2001 21:08, Jesse Swensen wrote: > >> This should be a quick one, but I can't seem to wrap my brain around > >> it. All I need to do is replace leading or trailing spaces with > >> underscores. If there is spaces in between words, leave them alone. > but I wanted to convert

Re: [PHP] Regex help needed...

2001-02-12 Thread Jesse Swensen
on 2/12/01 4:30 PM, Christian Reiniger at [EMAIL PROTECTED] wrote: > On Monday 12 February 2001 21:08, Jesse Swensen wrote: This should be a quick one, but I can't seem to wrap my brain around it. All I need to do is replace leading or trailing spaces with underscores. If there is

RE: [PHP] Regex help needed...

2001-02-13 Thread PHPBeginner.com
Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Jesse Swensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 13, 2001 4:39 AM To: PHPBeginner.com Subject: Re: [PHP] Regex help needed...

RE: [PHP] RegEx gurus help...

2001-12-10 Thread Jack Dempsey
from the way you describe, i can't help but think that it'd be one hell of a regex.if all you're doing is stripping out .. i'd load up your fav editor and do a search and replace where you can approve each changeor, just change them all and fix what's broken.it'll be much quicker than

RE: [PHP] RegEx gurus help...

2001-12-10 Thread Brian V Bonini
Hey thanks! That was a good starting point... -Brian > -Original Message- > From: Andrey Hristov [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 10, 2001 9:35 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] RegEx gurus help... > > >

Re: [PHP] RegEx gurus help...

2001-12-12 Thread Andrey Hristov
The code below does almost of the job. There is only one problem. If some path is absolute to the server /aaa/bbb/ the path get file://aaa// but I think no problems with apache. HTH Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS a URL, a link to an external JS

Fwd: Re: [PHP] Regex error

2002-01-18 Thread bvr
split() takes a regular expression, this means you have to escape the | char with a \ like this: $rgTemp = split("\|",$szTag); bvr. On Fri, 18 Jan 2002 14:40:25 -0800, PHP List wrote: >Hi, >Can someone please tell me why the this is happening: > >1) $szTag = "test|3"; >2) $rgTemp = spli

RE: [PHP] Regex function needed

2002-02-07 Thread Douglas Maclaine-cross
$string = ereg_replace("[A-Za-z']{1,3}", "", $string); // don't forget "I'm" I haven't checked but something like this. -Original Message- From: Michael Kimsal [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 9:59 To: [EMAIL PROTECTED] Subject: [PHP] Regex function needed Lo

Re: [PHP] Regex function needed

2002-02-07 Thread Edward van Bilderbeek - Bean IT
I don't know if this is the best way but: $str = "This is or was a test for short words"; while (ereg(" [a-z]{1,3} ", $str)) { $str = eregi_replace(" [a-z]{1,3} ", " ", $str); } print $str; this replaces all occurences of a space followed by 1,2 or 3 alphabetic characters followed by a space.

Re: [PHP] Regex function needed

2002-02-07 Thread Edward van Bilderbeek - Bean IT
})[a-z']{1,3}([ ]{1}|[,]{1}|[.]{1} |[:]{1})", "\\2", $str); } Greets, Edward print $str; - Original Message - From: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Michael Kimsal" <[EMAIL PRO

RE: [PHP] Regex function needed

2002-02-07 Thread Martin Towell
To: [EMAIL PROTECTED]; Michael Kimsal Subject: Re: [PHP] Regex function needed this might even work beter, to take comma's and periods etecetera into account to: $str = "This is or was a test for short words, although an, should be deleted to."; while (ereg(" [a-z]{1,3} ", $s

Re: [PHP] Regex function needed

2002-02-07 Thread Bas Jobsen
Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal: > Looking for a regex (preg or ereg) to remove > all 1, 2 and 3 character words. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regex function needed

2002-02-07 Thread Edward van Bilderbeek - Bean IT
m: "Bas Jobsen" <[EMAIL PROTECTED]> To: "Michael Kimsal" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 08, 2002 1:10 AM Subject: Re: [PHP] Regex function needed > Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal: > > Looking

RE: [PHP] Regex function needed

2002-02-07 Thread Douglas Maclaine-cross
;, $str); $str = eregi_replace('^[a-z\']{1,3} ', '', $str); $str = eregi_replace('^[a-z\']{1,3}([^a-z\'])', '\1', $str); $str = eregi_replace(' [a-z\']{1,3}$', '', $str); $str = eregi_replace('([^a-z\' ])[a-

RE: [PHP] Regex function needed

2002-02-07 Thread Martin Towell
ot;.", $str); $str = str_replace(",.", ".", $str); echo $str; -Original Message- From: Douglas Maclaine-cross [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 11:09 AM To: 'Edward van Bilderbeek - Bean IT'; Michael Kimsal; [EMAIL PROTECTED]

Re: [PHP] Regex function needed

2002-02-08 Thread Michael Kimsal
Bas Jobsen wrote: > Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal: > >>Looking for a regex (preg or ereg) to remove >>all 1, 2 and 3 character words. >> > > $string="over deze regex loop ik nu al de hele dag en een uur te piekeren. 't > wil niet! of wel! l'a."; > $string=" ".$str

RE: [PHP] regex expession problems

2002-03-27 Thread Martin Towell
I don't have that much experience with preg* functions but if that's exactly how you've got it in your code, shouldn't there be no spaces?? that is: preg_match("/http:\/\/ | [[:space:]]/i",$valToEval); * * \-\both of these should be removed ?

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
try \\1 - Original Message - From: "Phil Ewington" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 5:03 PM Subject: [PHP] RegEx (back referencing) > Hi, > > I am am writing a function to color code and indent JavaScript source using > regular e

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
start. Danny. - Original Message - From: "Phil Ewington" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 5:52 PM Subject: RE: [PHP] RegEx (back referencing) > \\1 outputs nothing at all wrapped in fo

RE: [PHP] RegEx (back referencing)

2002-08-03 Thread Phil Ewington
What's strange is that doing an ord($string) returns 171, which is a '1/2' char. So why does PHP convert the pattern match?? > -Original Message- > From: Phil Ewington [mailto:[EMAIL PROTECTED]] > Sent: 03 August 2002 17:04 > To: PHP General > Subject: [PHP] RegEx (back referencing) > >

RE: [PHP] RegEx (back referencing)

2002-08-03 Thread Phil Ewington
Danny, It still doesn't work, could this be a problem in 4.0.4pl1 ?? > -Original Message- > From: Danny Shepherd [mailto:[EMAIL PROTECTED]] > Sent: 03 August 2002 18:11 > To: [EMAIL PROTECTED]; PHP-General > Subject: Re: [PHP] RegEx (back referencing) > >

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
TECTED]> Sent: Saturday, August 03, 2002 6:23 PM Subject: RE: [PHP] RegEx (back referencing) > Danny, > > It still doesn't work, could this be a problem in 4.0.4pl1 ?? > > > > > -Original Message- > > From: Danny Shepherd [mailto:[EMAIL PROTECTED

Re: [PHP] RegEx (back referencing)

2002-08-03 Thread Danny Shepherd
on" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 8:54 PM Subject: RE: [PHP] RegEx (back referencing) > Danny, > > OK, the input string is the contents of a file, the idea is to output color > coded and indented code

Re: [PHP] RegEx (back referencing)

2002-08-04 Thread Analysis & Solutions
On Sat, Aug 03, 2002 at 05:03:36PM +0100, Phil Ewington wrote: > Hi, > > I am am writing a function to color code and indent JavaScript source using > regular expressions and cannot seem to get back referencing working. What you're using isn't "back referencing," it's utilizing "substrings." B

Re: [PHP] regex match problem

2002-08-14 Thread Bas Jobsen
To Match: Tue, Jul 29, 2003 > $pregmatchstring="/([\s])*(Renewal\DDate|Registered\sthrough|Expires|Record >\sExp ires|Domain\sExpires|Expiry\sDate)([\D\s]*)(.*)/i"; You can change the last part of $pregmatchstring in: Expiry\sDate)([\D\s]*|\w{3},\s\w{3}\s\d{2},\s\d{4})(.*)/i"; You can f

Re: [PHP] regex help...again

2001-03-29 Thread elias
It's a lame way, but it works, I sure hope that someone can tell me how to do it in pure regexp. like how can i 'search for next occurence' in ereg or any regexp() in PHP - "; echo "matched: $match\n"; } ?> - ""David Balatero"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[E

Re: [PHP] regex help...again

2001-03-30 Thread Christian Reiniger
On Friday 30 March 2001 06:47, you wrote: > Ok, i have a text file with lines that looks like this: > > 14```value```value2`value3 > > This would be fine, except...there are sometimes more than in > other columns, so id like it to be > > 14``value``value2``value3 $new = preg_replace ('/`

Re: [PHP] regex help...again

2001-03-30 Thread elias
So as you seem to be good with regexps, can you tell me how i can write a code that will search for next occurence in a string? where pattern is a regexp and a string is long and ofcourse there will be lots of pattern matchs in it...? thanks "Christian Reiniger" <[EMAIL PROTECTED]> wrote in mess

Re: [PHP] regex help...again

2001-03-30 Thread Christian Reiniger
On Saturday 31 March 2001 00:07, you wrote: > So as you seem to be good with regexps, can you tell me how i can write > a code that will search for next occurence in a string? > where pattern is a regexp and a string is long and ofcourse there will > be lots of pattern matchs in it...? What about

Re: [PHP] Regex help please

2009-03-27 Thread haliphax
On Fri, Mar 27, 2009 at 9:40 AM, Shawn McKenzie 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 backref, or the fac

Re: [PHP] Regex help please

2009-03-27 Thread Shawn McKenzie
haliphax wrote: > On Fri, Mar 27, 2009 at 9:40 AM, Shawn McKenzie 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 >> t

Re: [PHP] regex brain-toot

2006-06-19 Thread John Nichel
Jay Blanchard wrote: I have a field that contains a value in parenthesis', but also contains other text, for instance; (it is a legacy app that I am working with, and by legacy I am saying pre-1980) Upper voltage (124.1) I know that \([0-9]*\) will get me (124.1), but I am totally forgetting ho

Re: [PHP] regex brain-toot

2006-06-19 Thread Robert Cummings
On Mon, 2006-06-19 at 14:42, John Nichel wrote: > Jay Blanchard wrote: > > I have a field that contains a value in parenthesis', but also contains > > other text, for instance; (it is a legacy app that I am working with, > > and by legacy I am saying pre-1980) > > > > Upper voltage (124.1) > > >

RE: [PHP] regex brain-toot

2006-06-19 Thread Jay Blanchard
[snip] \(([0-9]*)\) [/snip] I had done this before and still get the parenthesis... ereg("\(([0-9]*)\)", "Upper Voltage (124.1)", $regs); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] regex brain-toot

2006-06-19 Thread Jay Blanchard
[snip] You won't match the dot btw: \(([.0-9]*)\) Which is crude since it will match more than one dot :) [/snip] Typo on my part \(([0-9\.]*)\)...but still gets parenthesis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] regex brain-toot

2006-06-19 Thread John Nichel
Jay Blanchard wrote: [snip] \(([0-9]*)\) [/snip] I had done this before and still get the parenthesis... ereg("\(([0-9]*)\)", "Upper Voltage (124.1)", $regs); Anot PCRE. Can't help you there, as I've never used the ereg functions. However... preg_match ( "/\((\d{1,}.*?)\)/", "U

RE: [PHP] regex brain-toot

2006-06-19 Thread Jay Blanchard
[snip] Anot PCRE. Can't help you there, as I've never used the ereg functions. However... preg_match ( "/\((\d{1,}.*?)\)/", "Upper Voltage (124.1)", $regs ); [/snip] Still returns parentheses ereg("[^\(][0-9\.]*" , "Upper Voltage (124.1)", $regs ); gets rid of opening bracket, but e

Re: [PHP] regex brain-toot

2006-06-19 Thread John Nichel
Jay Blanchard wrote: [snip] Anot PCRE. Can't help you there, as I've never used the ereg functions. However... preg_match ( "/\((\d{1,}.*?)\)/", "Upper Voltage (124.1)", $regs ); [/snip] Still returns parentheses ereg("[^\(][0-9\.]*" , "Upper Voltage (124.1)", $regs ); gets rid of

RE: [PHP] regex brain-toot

2006-06-19 Thread Jay Blanchard
[snip] Do you have to use ereg? The preg_match pattern I posted works fine. It will return an array, first element being the whole string it matched, next element will be what it matched _inside_ the parentheses (less the parentheses) (if it matches anything that is). [/snip] Thanks Johnth

Re: [PHP] Regex in PHP

2008-06-03 Thread Liran Oz
You can use this: $str = '[EMAIL PROTECTED]'; preg_match('/[EMAIL PROTECTED]@(.+)/', $str, $matches); var_dump($matches);//will be in $matches[1] Or without regex: echo substr($str, strpos($str, '@')+1); Liran - Original Message - From: "VamVan" <[EMAIL PROTECTED]> To: Sent: We

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 > h

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 case-s

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 > c

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 > > b

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 str

<    1   2   3   4   5   6   >