Re: [PHP] preg_replace - I don't have a clue

2006-01-13 Thread Anthony Best
On 1/12/06, Frank Bax [EMAIL PROTECTED] wrote: reg_replace( ' (\d+\$)', '+$0', $prop ); /* results in dollar-alpha-space-space-plus-digits-dollar */ $Fencing +11$Lumber +17$Weight: 317 Stones$Energy Resist 2%$ Try: preg_replace( '/ (\d+\$)/', '+$1', $prop ); -- Anthony Best

Re: [PHP] preg_replace - I don't have a clue

2006-01-13 Thread Frank Bax
At 05:15 PM 1/13/06, Anthony Best wrote: On 1/12/06, Frank Bax [EMAIL PROTECTED] wrote: reg_replace( ' (\d+\$)', '+$0', $prop ); /* results in dollar-alpha-space-space-plus-digits-dollar */ $Fencing +11$Lumber +17$Weight: 317 Stones$Energy Resist 2%$ Try: preg_replace( '/

[PHP] preg_replace - I don't have a clue

2006-01-12 Thread Frank Bax
As I understand the docs for preg_replace(), I can enclose an PCRE expression in parenthesis and use a backreference in the replace string; but it's not working! Data coming from another system contains a lot of data in one text record which I must parse. Individual elements in the record