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

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 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 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
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
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 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 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 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 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
$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: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
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 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 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 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!

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-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 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 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 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 Walker, Roy
Regular Expressions? Help! 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]

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
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
#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
: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
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
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
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
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 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 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