Using r for strings and re library | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Using r for strings and re library

I was just wondering if itā€™s worth using r on all strings so they all become raw and therefore if you need to use the re library the r is already. Is this good practice?

27th Oct 2018, 8:07 AM
Thomas Hemming
1 Resposta
0
Because strings in regular expression sometimes uses \, there is a small risk that they would escape a newline or similar. With raw strings that would not happen.
10th Jun 2019, 9:20 PM
Seb TheS
Seb TheS - avatar