This is the string
(code)
Pivot: 96.75<br />Our preference: Long positions above 96.75 with targets @ 97.8 & 98.25 in extension.<br />Alternative scenario: Below 96.75 look for further downside with 96.35 & 95.9 as targets.<br />Comment the pair has broken above its resistance and should post further advance.<br />
(text)
"Pivot: 96.75
Our preference: Long positions above 96.75 with targets @ 97.8 & 98.25 in extension.
Alternative scenario: Below 96.75 look for further downside with 96.35 & 95.9 as targets.
Comment the pair has broken above its resistance and should post further advance.
"
the result should be
(code)
<b>Pivot</b>: 96.75<br /><b>Our preference</b>: Long positions above 96.75 with targets @ 97.8 & 98.25 in extension.<br /><b>Alternative scenario</b>: Below 96.75 look for further downside with 96.35 & 95.9 as targets.<br />Comment the pair has broken above its resistance and should post further advance.<br />
(text)
Pivot: 96.75
Our preference: Long positions above 96.75 with targets @ 97.8 & 98.25 in extension.
Alternative scenario: Below 96.75 look for further downside with 96.35 & 95.9 as targets.
Comment the pair has broken above its resistance and should post further advance.
The porpuse:
Wrap all the words before :
sign.
I've tried this regex: ((\A )|(<br />))(?P<G>[^:]*):
, but its working only on python environment. I need this in PHP:
$pattern = '/((\A)|(<br\s\/>))(?P<G>[^:]*):/';
$description = preg_replace($pattern, '<b>$1</b>', $description);
Thanks.