3
I’ve been studying quite the regex, but I found myself trying to "clear" 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)";
Like all the text before valor
, has a -
separating them, I used the explode
:
$string2 = explode("-", $string);
I then get the Mais de
, wanted to join the (+05)
to this result, but in the codes I have tried with preg_match
only return me the (05)
without the +
, remembering that this symbol of more can also be a symbol of less -
, guy (-05)
, someone knows how delimito quotes in regex?
I want the end result to be something like:
More than (+05)
Instead of string
original.
For those who help me, please comment your code for me try to understand.
Put the final result that you want. I don’t understand what you want to do...
– Papa Charlie
Sorry, I updated the question!
– Cassiano José