Posted by Disco Octopus on 11/18/61 11:43
Hi,
I think I am need of a regular expression with regards to a str_replace
need that I have...
I have a string like this one...
"text text text{
text
} text {text text } t {text} txt { text }"
I need to replace all occurances of "{" with "{ " and "}" with " }" where
the following rules apply...
replace "{" with "{ " when the character to the right of "{" is NOT
<newline> and is NOT <space> and is NOT <tab>.
replace "}" with " }" when the character to the left of "}" is NOT
<newline> and is NOT <space> and is NOT <tab>.
So, the result in my example above would be....
"text text text{
text
} text { text text } t { text } txt { text }"
Would anyone possibly know how to do this?
Thanks
--
most midwives do not have children
Navigation:
[Reply to this message]
|