Hi I am trying to replace ,
with |
from a long string with in braces []
but the following seems to be failed.
Here is the string.
ID: 3a0dd504341fb10a055xxxxxx, time: Wed Feb 01 12:54:39 EST 2012, client: 10.192.34.13, user: User [ID: 1456xcvererwe, session ID: sdfweerwer234325433 ], action: USER_ACTION_ITEM, action id: 36014, result: FAIL, reason: USER_EXCEPTION, arguments: [abcd, test12 , testing ]
Here is what I want as output.
ID: 3a0dd504341fb10a055xxxxxx, time: Wed Feb 01 12:54:39 EST 2012, client: 10.192.34.13, user: User [ID: 1456xcvererwe | session ID: sdfweerwer234325433 ], action: USER_ACTION_ITEM, action id: 36014, result: FAIL, reason: USER_EXCEPTION, arguments: [abcd | test12 | testing ]
I tried following
$text = preg_replace("/(^[)(.*)(])/U","|",$text);