Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Tobias Engelhardt
Thanks, that solved the problem...



Mike Migurski wrote:

i hope someone can help me out... i have to replace


with

any ideas? thank you!


PCRE style:
'//'
replaced by ''.
-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

--

Teamnet GmbH

Technologiepark 20
33100 Paderborn
Tel.: 0 52 51 / 68 77 22
Fax: 0 52 51 / 68 77 21
www.teamnet.de
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Brad Pauly
On Fri, 2004-01-16 at 10:21, Brad Pauly wrote:
> On Fri, 2004-01-16 at 10:07, Tobias Engelhardt wrote:
> > That is not possible because the id's are hard-coded in thousands of 
> > html-pages. Not a very good idea, i know. It wasn't mine... I *have* to 
> > use search/replace. (A script processes each file in the directory)
> 
> Ah, I see. I think you could use str_replace (untested):
> 
> $a = 'order.php?order_id=';
> $b = 'order_';
> $c = '';
> 
> $new = str_replace($a, $b, $c).'.html';

Whewps. I just realized I didn't pull the '>' off the end.

- Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Brad Pauly
On Fri, 2004-01-16 at 10:07, Tobias Engelhardt wrote:
> That is not possible because the id's are hard-coded in thousands of 
> html-pages. Not a very good idea, i know. It wasn't mine... I *have* to 
> use search/replace. (A script processes each file in the directory)

Ah, I see. I think you could use str_replace (untested):

$a = 'order.php?order_id=';
$b = 'order_';
$c = '';

$new = str_replace($a, $b, $c).'.html';

- Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Mike Migurski
>i hope someone can help me out... i have to replace
>
>
>with
>
>
>any ideas? thank you!

PCRE style:
'//'
replaced by ''.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Tobias Engelhardt
That is not possible because the id's are hard-coded in thousands of 
html-pages. Not a very good idea, i know. It wasn't mine... I *have* to 
use search/replace. (A script processes each file in the directory)

Brad Pauly wrote:

What about just using the variable to build the name?

$file_name = 'order_'.$_GET['order_id'].'.html';

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Regular Expression for Search/Replace

2004-01-16 Thread Brad Pauly
On Fri, 2004-01-16 at 09:49, Tobias Engelhardt wrote:
> Hi list,
> i hope someone can help me out... i have to replace
> 
> 
> with
> 
> 
> any ideas? thank you!

What about just using the variable to build the name?

$file_name = 'order_'.$_GET['order_id'].'.html';

- Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php