RegEx with preg_replace

From: Sebastian Araya (araya.s_at_numisys.com.ar)
Date: 12/31/03


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.



Relevant Pages

  • Re: Origin of Mahjong (MJ) / other Hu Pai Design
    ... Ching and mah-jong. ... A large rope is somewhat like a big string? ... bushel assigned to it, besides string of cash. ... As I quoted from Himly article, the term cake appears to derive from ...
    (rec.games.mahjong)
  • Re: So here I yam, wondering about what to do for breakfast.
    ... Fresh croissants and sourdough rolls for breakfast ... and lunch, and all day, English Walnut Pound Cake, cream cheese spritz ... peanut butter cookies, white chocolate currant cake (a moist yellow cake ...
    (rec.food.cooking)
  • Re: So here I yam, wondering about what to do for breakfast.
    ... My kind of breakfast and/or dinner! ... lunch, and all day, English Walnut Pound Cake, cream cheese spritz cookies, ... junk including pretzels coated with white chocolate), peanut butter cookies, ...
    (rec.food.cooking)
  • I think i figured out the list problem [python]
    ... I took a break and got breakfast. ... If I understand this right, when I take a string and split it, it returns ... tools and the latest trends at MSN Life ...
    (comp.lang.python)
  • Re: ASCII Code lesbar machen
    ... Belle & Sebastian - The white collar boy ... Womit kann man diesen String und wieder lesbar machen? ...
    (de.comp.os.unix.shell)