Solucionario Boyce Diprima 4 Edicion
Solucionario Boyce Diprima 4 Edicion
Solution Manual- Boyce-DiPrima - Ninth Edition ebooks on DigitalOcean - BookWalker.
Could you help me? Thank you very much for your help.
A:
Looks like you need to use the \q two-character escape sequence, like \q.+-\q in the regex.
See the official Python documentation for details.
Your code would become
pattern = r"\d\d\d(\.\d\d)?(\d\d\.\d\d)?"
(r"(\[\d+\.\d+\]),([\d+\.\d+\])")
EDIT:
If your code is only outputting the first line of output from
preg_replace('~(.*?)\[\d+\.\d+\]~', "$1
-$2
", $search1);
preg_replace('~(.*?)\[\d+\.\d+\]~', "$1
-$2
", $search2);
you could replace that with
echo preg_replace('~(.*?)\[\d+\.\d+\]~', "$1
-$2
", $search1);
echo preg_replace('~(.*?)\[\d+\.\d+\]~', "$1
-$2
", $search2);
A:
Add a \ at the beginning of the match. For example
preg_replace('~(.*)\\[\d+\.\d+\]~', "$1
-
$2
", $search1);
preg_replace('~(.*)\\[\d+\.\d+\]~', "$1
-
$2
", $search2);
This issue causes the result in third line of output because the "4.0.0" could not match with your regex.
Support for
Read More