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: [EMAIL

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

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

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 front and ones

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 sorts

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

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 to

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 to write to

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 right I'm

Re: [PHP] regular expressions help please

2002-04-30 Thread John Fishworld
Duh ! lol sorry ! Example 1 html head meta http-equiv=content-type content=text/html;charset=iso-8859-1 meta name=generator content=Edit Plus titleLocations/title /head body bgcolor=#6699FF div align=center pfont color=blackWelcome tobr /fontfont color=redimg src=lg_imode.gif alt=

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 string

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 ! img src=/db/imodeklein/edgar-IMODE-1-.gif vspace=2br#59091;nbsp;a href=imode.fpl?op=imodecardprefix=IMODEnummer=1suffx=uid=55%2eFAGAEpa Unfortunately, no. Could you post say 20 lines of this file you're talking

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 Try

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 regexs !

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] =

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 2002,

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

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, 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 To: '[EMAIL PROTECTED

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
. 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); this would set: $my_vars[0] = variable1

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. The command I am

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]] Sent: Monday, March 25

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
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 capture the output as an array), system(), shell_exec

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 = $prog $cmdline $trimline

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Rick Emery
]' 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- From: Rick Emery [mailto:[EMAIL

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, 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: Walker, Roy [mailto:[EMAIL PROTECTED]] Sent: Monday

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? Help! I just

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
? 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] Regular Expressions? Help! I just

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: Monday, March 25

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 this.

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

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] Regular Expressions? Help

RE: [PHP] Regular Expressions? Help!

2002-03-25 Thread Walker, Roy
PM To: 'Darren Gamble'; 'Walker, Roy'; '[EMAIL PROTECTED]' Subject:RE: [PHP] Regular Expressions? Help! 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