I've been studying regex a lot, but I got caught trying to "clean" a text, leaving only the first occurrence, and the data in parentheses, the string is like this :
$string = "Mais de - valor: R$3.21 - Tipo: (+05)";
As all text before valor
, has -
separating them, I used explode
:
$string2 = explode("-", $string);
I then get, Mais de
, I wanted to add (+05)
to this result, but in the codes I've tried with preg_match
only returns (05)
without +
, remembering that this symbol of more can also be a symbol of less than -
, type (-05)
, does anyone know how to delimit quotes in regex ?
I want the end result to be something like:
More than (+05)
Instead of% original%.
For those who help me, please comment on your code for me to try to understand.