RegEx with preg_replace
From: Sebastian Araya (araya.s_at_numisys.com.ar)
Date: 12/31/03
- Next message: knocte: "Re: ereg_replace(): this drives me nuts"
- Previous message: Sean: "Help Desk PHP"
- Next in thread: Pedro Graca: "Re: RegEx with preg_replace"
- Reply: Pedro Graca: "Re: RegEx with preg_replace"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 31 Dec 2003 09:20:48 -0800
Hello,
I have a string like this:
var1: value1...valueI var2: value1...valueJ ... varN:
value1...valueK
this is an example:
breakfast: coffee eggs lunch: sandwich apple dinner: chicken wine
cake
I'm trying to use preg_replace to change "lunch:" values to a code
number, in order to get in the example:
breakfast: coffee eggs lunch: 0503 dinner: chicken wine cake
keeping the rest of variables and values unchanged.
Take in account, that I'm only sure that I have the "lunch:" word
delimitation (and its values), I don't know if exists "breakfast:" or
"dinner:"; but I'm sure that if the variable exists, then the values
exists too.
Thanks,
Sebastian.
- Next message: knocte: "Re: ereg_replace(): this drives me nuts"
- Previous message: Sean: "Help Desk PHP"
- Next in thread: Pedro Graca: "Re: RegEx with preg_replace"
- Reply: Pedro Graca: "Re: RegEx with preg_replace"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|