Re: [PHP] Regular Expressions...

2002-01-18 Thread Jason Wong
On Friday 18 January 2002 22:09, Tony Arnold wrote: > Howdy people... I want to extract the name of a hyperlink which looks like > this: > > this is the name! > > I tried to do this: > > ereg(">([a-zA-Z0-9_. -]*)<",$hlink, $reg3); > > and it works if it only consists of the above characters, how c

RE: [PHP] Regular Expressions...

2002-01-18 Thread Tony Arnold
Thank you! -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: den 18 januari 2002 15:14 To: Tony Arnold; [EMAIL PROTECTED] Subject: Re: [PHP] Regular Expressions... On Friday 18 January 2002 22:09, Tony Arnold wrote: > Howdy people... I want to extract the name o

Re: [PHP] regular expressions

2002-02-21 Thread Edward van Bilderbeek - Bean IT
first of all: why do you use: [0-9][0-9]*... you better use: [0-9]+ then same goes for \w and I guess you don't need the ('s and )'s either... Edward - Original Message - From: "German Castro Donoso" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 21, 2002 5:26 PM Su

Re: [PHP] Regular Expressions

2002-04-23 Thread Evan Nemerson
Uhhh... something like ereg("[_a-zA-Z\-]+\@[\.a-zA-Z\-]+\.com",$variable); SHOULD work... If you want to make sure they're @domain.com instead of any domain, try... ereg("[_a-zA-Z\-]+\@[\.a-zA-Z\-]+domain\.com",$variable); if you want to validate e-mail address formats, there is (if memory se

Re: [PHP] Regular Expressions

2002-04-24 Thread Evan Nemerson
> Could you help me with this? > > Devin > > > -Original Message- > From: Evan Nemerson [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 23, 2002 4:38 PM > To: Devin Atencio; [EMAIL PROTECTED] > Subject: Re: [PHP] Regular Expressions > > > Uhhh... somethin

Re: [PHP] Regular Expressions

2002-04-24 Thread Miguel Cruz
On Wed, 24 Apr 2002, Evan Nemerson wrote: > ereg("([_a-zA-Z\-]+|\*)\@[\.a-zA-Z\-]+\.com",$variable); > should work, but test it. I'm not 100% the wildcard part will work. An internet domain name cannot contain an underscore ( _ ). ...and a whole lot of them don't end in .com! miguel -- PHP G

Re: [PHP] Regular Expressions

2002-04-24 Thread Evan Nemerson
A domain cannot contain an underscore, but unless i'm mistaken the USERNAME can. the domain name REGEX is [\.a-zA-Z\-]+ You're right about the .com. senior moment. here's a better version ereg("([_a-zA-Z\-]+|\*)\@[\.a-zA-Z\-]+\.[\.a-zA-Z\-]+",$variable); won't make sure there are letters betwe

Re: [PHP] Regular Expressions

2002-04-24 Thread Miguel Cruz
On Wed, 24 Apr 2002, Evan Nemerson wrote: > A domain cannot contain an underscore, but unless i'm mistaken the > USERNAME can. the domain name REGEX is [\.a-zA-Z\-]+ > > ereg("([_a-zA-Z\-]+|\*)\@[\.a-zA-Z\-]+\.[\.a-zA-Z\-]+",$variable); Right you are. I spaced out right past the @. But on the o

RE: [PHP] Regular Expressions

2002-04-24 Thread John Holmes
dating or what...but maybe it'll help?? ---John Holmes... > -Original Message- > From: Miguel Cruz [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 24, 2002 5:17 PM > To: Evan Nemerson > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Regular Expressions > > O

Re: [PHP] Regular Expressions

2002-04-24 Thread Evan Nemerson
#x27;ll help?? > > ---John Holmes... > > > -Original Message- > > From: Miguel Cruz [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, April 24, 2002 5:17 PM > > To: Evan Nemerson > > Cc: [EMAIL PROTECTED] > > Subject: Re: [PHP] Regular Expressions

Re: [PHP] Regular Expressions

2002-04-24 Thread Evan Nemerson
Okay... ereg("([_a-zA-Z\-\=\+0-9]+|\*)\@[\.a-zA-Z\-0-9]+\.[\.a-zA-Z\-0-9]+",$variable); Anything else? That one works, right??? So far we've got a-z, A-Z, underscores, hyphens, equals, and pluses. Oh crap numbers! Okay added it in up there. Anything else? On Wednesday 24 April 2002 17:17 p

Re: [PHP] Regular Expressions...

2002-05-31 Thread Michael Sims
On Fri, 31 May 2002 12:32:29 +0100, you wrote: >example of the contents of $file that might pass is: > >advance_racingx_14_4_29.pdf > >another might be, which would not pass is: > >advance_fork10_3_4_11.pdf If you need it to be in that specific order, use the following: if(preg_match("/advance.

RE: [PHP] Regular expressions?

2001-11-15 Thread Andrew Kirilenko
Hello! You should write something like this: if (preg_match("/(.*)<\/H2>/Ui", $str, $matches)) echo $matches[1]; U modufier - ungreedy match i modifier - case insentensive >Where can I start to learn reg-exp? If you want to get more abot regexp - read php manual at least.Or try to fi

RE: [PHP] Regular expressions?

2001-11-16 Thread Jack Dempsey
If you'd really like to develop your regex skills, and everyone should, pickup Mastering Regular Expressions by Jeffrey Friedl(O'Reilly Press). Its the best out there, and will probably teach you more than you thought possible. Jack -Original Message- From: Martin Thoma [mailto:[EMAIL PR

Re: [PHP] Regular Expressions.

2001-11-20 Thread Andrey Hristov
$message = preg_match ("~\[color=([\w#]+)\](.*?)\[/color\]~", "$2"); try with this - Original Message - From: "Jeff Lewis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, November 20, 2001 3:37 PM Subject: [PHP] Regular Expressions. I'm trying to port over some Perl to PHP and

Re: [PHP] Regular Expressions.

2001-11-20 Thread Stefan Rusterholz
I ran into that problem also when I first tried to script with PHP. 1. preg_match("/yourexpression/",$text,$matches); always set the / at beginning and end of the regex (as you did in perl) 2. preg_match("/\[/", this won't match the char [ because of the double-quotes (") it es

Re: [PHP] Regular Expressions.

2001-11-20 Thread Andrey Hristov
is" <[EMAIL PROTECTED]> Cc: "PHP" <[EMAIL PROTECTED]> Sent: Tuesday, November 20, 2001 4:33 PM Subject: Re: [PHP] Regular Expressions. > I ran into that problem also when I first tried to script with PHP. > 1. > preg_match("/yourexpression/",$text

Re: [PHP] Regular expressions?

2001-11-16 Thread Papp Gyozo
[^>]*)>.*'.$quoted.'(?>[^<]*)!Ui', $source, $matches); ?> good point to start: http://www.php.net/manual/en/ref.pcre.php - Original Message - From: "Martin Thoma" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 16, 2001 8:30 AM Subject: [PHP] Regular expre

Re: [PHP] regular expressions

2002-01-05 Thread Michael Sims
At 10:16 PM 1/5/2002 -0500, Gerard Samuel wrote: >Need some help with this one. Dont know where to begin. I have content >in a string and a constant that changes depending on if yourre in the root >or in a directory. >The purpose of the constant is to provide dynamic links. >The string will ha

Re: [PHP] regular expressions

2002-01-05 Thread Michael Sims
At 10:22 PM 1/5/2002 -0600, Michael Sims wrote: >function insertpath($string) { > > return preg_replace("/( href=\")(.*\">.*<\/a>)/i","$1"._CONSTANT."$2",$string); > >} >?> Forgot to mention that the "i" at the end of the regex means to make the match case-insensitive... -- PHP Genera

RE: [PHP] Regular expressions

2001-07-17 Thread Jack Dempsey
Checkout www.php.net/strtr -Original Message- From: Philip Murray [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 1:31 AM To: PHP General List Subject: [PHP] Regular expressions In Perl you can do this: $foo =~ tr/012/mpf/; Which is the same as: $foo = str_replace("

Re: [PHP] Regular Expressions?

2001-04-19 Thread elias
It seems good to me except there is an unbalanced '('... -elias http://www.kameelah.org/eassoft ""Jason Caldwell"" <[EMAIL PROTECTED]> wrote in message 9boi65$ipb$[EMAIL PROTECTED]">news:9boi65$ipb$[EMAIL PROTECTED]... > I'm looking to compare if my array values match any digits or alpha > char

Re: [PHP] Regular Expressions?

2001-04-19 Thread Brian Clark
Hi Jason, @ 1:43:19 AM on 4/20/2001, Jason Caldwell wrote: ... > I want to match any of the following: > 1.1 or a.a > or . or .<-- any number of digits (0-9) or alpha (a-z) > on either side of the dot. > if(eregi("^([0-9][a-z]\.[0-9][a-z]", $myArray[x])) Your parentheses

Re: [PHP] Regular Expressions?

2001-04-19 Thread Jason Caldwell
Thanks Brian! Very helpful. Is there a good website that covers Regular Expressions? Jason "Brian Clark" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Jason, > > @ 1:43:19 AM on 4/20/2001, Jason Caldwell wrote: > > ... > > I want to match any of the fo

Re: [PHP] Regular Expressions?

2001-04-19 Thread Brian Clark
Hi Jason, @ 2:19:48 AM on 4/20/2001, Jason Caldwell wrote: > Thanks Brian! No problemo. > Very helpful. Is there a good website that covers Regular Expressions? There is a GNU Regular Expressions Document out there somewhere if you want to know most of it inside an out (google.com will proba

Re: [PHP] Regular Expressions?

2001-04-19 Thread Jason Caldwell
I'm a little lost as to the exact function of the following: ^ and $ I noticed in the example below... that when I added the $ to the end of the expression, I wasn't able anymore to put a non-alphanumeric character in the end, for example (without the $) I was able to enter the following and ge

Re: [PHP] Regular Expressions?

2001-04-19 Thread Jason Caldwell
Actually ordered that very book (earlier) tonight on Amazon. Looking forward to getting it. Thanks. "Brian Clark" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Jason, > > @ 2:19:48 AM on 4/20/2001, Jason Caldwell wrote: > > > Thanks Brian! > > No proble

RE: [PHP] Regular Expressions?

2001-04-19 Thread Jack Dempsey
] Subject: Re: [PHP] Regular Expressions? I'm a little lost as to the exact function of the following: ^ and $ I noticed in the example below... that when I added the $ to the end of the expression, I wasn't able anymore to put a non-alphanumeric character in the end, for example (without

Re: [PHP] Regular Expressions?

2001-04-19 Thread David Robley
On Fri, 20 Apr 2001 15:49, Jason Caldwell wrote: > Thanks Brian! > > Very helpful. Is there a good website that covers Regular Expressions? > > Jason > >From my collection - there are duplicates^W^W^W. Heck, might as well tidy this up. There aren't duplicates. Thanks to those who have variously

Re: [PHP] Regular Expressions?

2001-04-19 Thread Jason Caldwell
gt; if you put ^ at the start of your regexp, that means you want the start of > the string to match your expression...$ is used for the end of the string... > > -jack > > -Original Message- > From: Jason Caldwell [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 20, 200

Re: [PHP] Regular Expressions?

2001-04-19 Thread Brian Clark
Hi Jason, @ 2:40:34 AM on 4/20/2001, Jason Caldwell wrote: > I'm a little lost as to the exact function of the following: > ^ and $ ^ beginning of a string. $ end of a string. > I noticed in the example below... that when I added the $ to the end of the > expression, I wasn't able anymore to

Re: [PHP] Regular Expressions?

2001-04-19 Thread Brian Clark
Hi Jason, @ 2:43:26 AM on 4/20/2001, Jason Caldwell wrote: > Actually ordered that very book (earlier) tonight on Amazon. Looking > forward to getting it. It's likely to be one of the most valuable books you own. -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list

Re: [PHP] Regular Expressions?

2001-04-19 Thread Jason Caldwell
Brian -- Sorry if I seem dense. Your answer (although probably right on target) leaves me still confused :-) The example you gave me: $string = '.'; print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string) ? 'matched' : 'no match'); Now with your example (above) the following MATCHED (wh

Re: [PHP] Regular Expressions?

2001-04-19 Thread Brian Clark
Hi Jason, @ 3:08:06 AM on 4/20/2001, Jason Caldwell wrote: > Sorry if I seem dense. Your answer (although probably right on target) > leaves me still confused :-) No problem at all. > The example you gave me: > $string = '.'; > print(eregi("^([[:alnum:]]+\.[[:alnum:]]+)", $string) ?

Re: [PHP] Regular Expressions?

2001-04-20 Thread Morgan Curley
I don't use ereg(i)? much myself but for a perl compat regex I would: /^(([0-9a-z](\2*))\.([0-9a-z](\2*)))/i the \# refer to parenthized matches starting at 1 and counting left parens. The match array index you will want is $myArray[1]. if you don't mind matching 1a2.1a2 you can use /^(([0-9a-z]+

RE: [PHP] Regular Expressions?

2001-04-20 Thread Chris Cocuzzo
Maybe I'm wrong on this, but could this regex also be used like this? if(eregi("^[a-zA-Z0-9]+\.[a-zA-Z0-9]+$", $myArray[x])) --Chris -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Friday, April 20, 2001 1:43 AM To: [EMAIL PROTECTED] Subject: [PHP] Regu

Re: [PHP] Regular Expressions?

2001-04-20 Thread Jason Caldwell
Ahh It makes more sense now. Thanks. Jason "Brian Clark" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Jason, > > @ 3:08:06 AM on 4/20/2001, Jason Caldwell wrote: > > > Sorry if I seem dense. Your answer (although probably right on target) > > leave

Re: [PHP] Regular expressions

2001-08-08 Thread ReDucTor
$line = htmlentities(stripslashes($line)); $line = nl2br($line); $line = eregi_replace("\[(link|url)=(.*)\](.*)\[/(link|url)\]","\\3",$line); $line = eregi_replace("\[color=(.*)](.*)\[/color\]", "\\2", $line); $line = eregi_replace("\[(blockquote|indent)\](.*)\[/(blockquote|ind

RE: [PHP] Regular Expressions....

2001-08-21 Thread Dave
below > >HEy, i am having major problems trying to work out this regular expression. >Regular expressions are still quite new to me, and i don't fully understand >them, so please bear with me... thanks! regex is a different beast... however if the text that you have isa actually as such, it is

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
With there be a specifc number of variables returne? Or can the number of variables vary? -Original Message- From: Walker, Roy [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 1:26 PM To: '[EMAIL PROTECTED]' Subject: [PHP] Regular Expressions? Help! I am trying to do a match fo

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
, Roy'; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! With there be a specifc number of variables returne? Or can the number of variables vary? -Original Message- From: Walker, Roy [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 1:26 PM T

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
nd it was empty. Any ideas? -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 1:54 PM To: 'Walker, Roy' Subject: RE: [PHP] Regular Expressions? Help! well, ya might try: $my_array = explode( "\" ",$output);

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
exec() -Original Message- From: Walker, Roy [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 2:05 PM To: '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! I just realized why nothing I was trying for the regular expressions wasn't working. T

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 2:07 PM To: 'Walker, Roy'; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! exec() -Original Message- From: Walker, Roy [mailto:[EMAIL PROTECTED]] Se

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
Roy [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 2:27 PM To: 'Rick Emery'; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! Perhaps it is how I am calling the $lines in a while loop.? I have tried `$cmd`, exec(), exec($cmd, $ouput) (to

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
:50 PM To: 'Walker, Roy'; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! exec() works for me. Remember, though, it returns only the LAST line. Have you tried the following to ensure it's constructing the command you think it is: $mycmd =

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
#x27;; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! The cmd is running running correctly as I see the output on the screen (this is being run from a command line). The command output is seen on the screen and nothing gets set to $output. -Original Message-

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
alker, Roy'; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! Again, I ask: Does $mycmd contain the command you expect to see $mycmd = "$prog $cmdline $trimline &"; print $mycmd; $output = exec($mycmd); -Original Message- From: Walk

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
When the exec'd program executes from the command line, does it output a blank line as its last line? -Original Message- From: Walker, Roy [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 2:05 PM To: '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions?

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
No. I think there is a carriage return (\n), but there is not a blank line at the end. -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 3:07 PM To: 'Walker, Roy'; '[EMAIL PROTECTED]' Subject: RE: [PHP]

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
: Monday, March 25, 2002 3:09 PM To: 'Rick Emery'; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regular Expressions? Help! No. I think there is a carriage return (\n), but there is not a blank line at the end. -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread heinisch
At 25.03.2002 14:26, you wrote: > >Perhaps it is how I am calling the $lines in a while loop.? I have tried >`$cmd`, exec(), exec($cmd, $ouput) (to capture the output as an array), >system(), shell_exec(). None of them let me capture the STDOUT from the >program. There has to be a way to do th

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Darren Gamble
Good day, exec() isn't very good at capturing output. It will only return the last line of output, which is designed mostly to capture error conditions. You would be best off using popen() and attaching a pipe to the output, and then just read from the pipe. More information can be found about

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
exec() can capture ALL output from a command if you supply an array as the second argument to it -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 3:58 PM To: 'Walker, Roy'; '[EMAIL PROTECTED]' Subject: RE: [PHP] Regul

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 4:30 PM To: 'Darren Gamble'; 'Walker, Roy'; '[EMAIL PROTECTED]' Subject:RE: [PHP] Regular Expressions? Help! exec() can capture ALL output from a command if you supp

Re: [PHP] Regular Expressions Help

2002-06-05 Thread Jim lucas
not sure why you have such a complex reg there, but will this work for you. preg_replace("/(http:\/\/)?([^\/ ]*)(.*);/", "http://\\2\\3";, $str); \\1 = http:// ; if there \\2 = domain \\3 = request_uri Jim Lucas - Original Message - From: "J. Younker" <[EMAIL PROTECTED]> To: <[EMA

Re: [PHP] Regular Expressions Help

2002-06-05 Thread J. Younker
Thanks, Jim! That's exactly what I needed. J. Jim Lucas wrote: > not sure why you have such a complex reg there, but will this work for you. > > preg_replace("/(http:\/\/)?([^\/ ]*)(.*);/", "http://\\2\\3";, $str); > > \\1 = http:// ; if there > \\2 = domain > \\3 = request_uri > > Jim Luca

Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong
On Tuesday 30 April 2002 15:51, Ed Lazor wrote: > I've been banging my head against regular expressions all night... help > would be greatly appreciated. Could you give me examples on how to do the > following? Is this for a programming assignment/exercise? Do you /have/ to use regex? Other met

RE: [PHP] regular expressions help please

2002-04-30 Thread Ford, Mike [LSS]
> -Original Message- > From: John Fishworld [mailto:[EMAIL PROTECTED]] > Sent: 30 April 2002 09:32 > > I'm trying to find files in my array > for example > ="lg_imode.gif" > and > ="/db/imodeklein/edgar-IMODE-1-.gif" > > I want to differentiate between the files with slash at the > fron

Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong
On Tuesday 30 April 2002 16:31, John Fishworld wrote: > I'm trying to find files in my array > for example > ="lg_imode.gif" > and > ="/db/imodeklein/edgar-IMODE-1-.gif" Perhaps you should clarify your problem. First of all does your array contain just gif files (ie *.gif) or does it contain all

Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld
Okay right I'm experimenting with an i-mode parser ! I copy the file (url entered) to a local location ! Then read through the whole file line at a time and change/replace the things that need replaceing ! On of the things that I need to replace is the links to the pictures so that they still show

Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong
On Tuesday 30 April 2002 19:17, John Fishworld wrote: > Okay right I'm experimenting with an i-mode parser ! > I copy the file (url entered) to a local location ! > Then read through the whole file line at a time and change/replace the > things that need replaceing ! > On of the things that I need

Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld
$imode_code = file("$url_file"); $file_name = basename($url_file); $path = dirname($url_file); $stripped_path = eregi_replace("^(.{2,6}://)?[^/]*/", "", $path); $next_path = eregi_replace($stripped_path, "", $path); $next_path_1 = eregi_replace("/$" , "", $next_path); // create and open a file t

Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong
On Tuesday 30 April 2002 19:43, John Fishworld wrote: > $imode_code = file("$url_file"); > $file_name = basename($url_file); > $path = dirname($url_file); > $stripped_path = eregi_replace("^(.{2,6}://)?[^/]*/", "", $path); > > On Tuesday 30 April 2002 19:17, John Fishworld wrote: > > > Okay righ

Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld
Duh ! lol sorry ! Example 1 Locations Welcome to Your Preference: 驪 Schwul Lesbisch Example 2 i-mode   Auswahl   Mehr Karten   Karten suchen   Impressum  Edgars Auswahl  verschicken  verschicken  verschicken  verschicken   http

Re: [PHP] regular expressions help please

2002-04-30 Thread Miguel Cruz
On Tue, 30 Apr 2002, Ed Lazor wrote: > Pull everything except a specific word from a sentence. For example, > pulling everything except the word run from "the water run was steep". $str = 'the water run was steep'; print preg_replace('/(\s*water)/', '', $str); > Pull all words from a str

Re: [PHP] regular expressions help please

2002-04-30 Thread Jason Wong
On Tuesday 30 April 2002 21:09, John Fishworld wrote: > Duh ! lol sorry ! >   href="imode.fpl?op=imodecard&prefix=IMODE&nummer=1&suffx=&uid=55%2eFAGAE&pa > > > > Unfortunately, no. Could you post say 20 lines of this file you're > > > > talking about. > > > > I mean the file that you're readin

Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld
Thanks after playing about with that I've got the following which does seem to work ! $imode_code[$i] = eregi_replace("(src=)(\")([a-z0-9_\/-]+\.gif)(\")", "\\1\\2$path/\\3\\2", $imode_code[$i]); Very very very slowly getting the hang of regexs ! What does your /i do at the end ??? Thanks > T

Re: [PHP] regular expressions help please

2002-04-30 Thread Miguel Cruz
On Wed, 1 May 2002, John Fishworld wrote: > Thanks after playing about with that I've got the following which does seem > to work ! > > $imode_code[$i] = eregi_replace("(src=)(\")([a-z0-9_\/-]+\.gif)(\")", > "\\1\\2$path/\\3\\2", $imode_code[$i]); > > Very very very slowly getting the hang of re

Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld
aha ! thats very strange then because mine works at the moment but if I add the /i at the end then it doesn't ! > On Wed, 1 May 2002, John Fishworld wrote: > > Thanks after playing about with that I've got the following which does seem > > to work ! > > > > $imode_code[$i] = eregi_replace("(src=)

Re: [PHP] regular expressions help please

2002-04-30 Thread Miguel Cruz
I wasn't paying that much attention. The /i is a preg thing. It's the same as changing from ereg to eregi. miguel On Wed, 1 May 2002, John Fishworld wrote: > aha ! > thats very strange then because mine works at the moment but if I add the /i > at the end then it doesn't ! > > > On Wed, 1 May

Re: [PHP] regular expressions: HUGE speed differences

2002-04-06 Thread heinisch
PIII 400MHz, 512Mb, SuSe 6.4, 2.2.14 smp, php 3.0.16, Completed in 0.76187908649445 seconds PIII 350MHz, 256Mb, Suse 7.3, 2.4.9, php 4.0.6, Completed in 2.6342689990997 seconds File Size:28537kb, But for "real tests", send the original file you use direct BTW How the hell did you develop this