Ver Mensaje Individual
  #16 (permalink)  
Antiguo 25/04/2011, 14:58
AlvaroG
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: duda sobre caracteres \x93 \x94

Ya que buscabas una forma de combinar el modificador r con el modificador u, me refería a esto:
Cita:
When an 'r' or 'R' prefix is used in conjunction with a 'u' or 'U' prefix, then the \uXXXX and \UXXXXXXXX escape sequences are processed while all other backslashes are left in the string. For example, the string literal ur"\u0062\n" consists of three Unicode characters: ‘LATIN SMALL LETTER B’, ‘REVERSE SOLIDUS’, and ‘LATIN SMALL LETTER N’. Backslashes can be escaped with a preceding backslash; however, both remain in the string. As a result, \uXXXX escape sequences are only recognized when there are an odd number of backslashes.
Código Python:
Ver original
  1. patron = re.compile('["\u201c\u201d]')
debería funcionarte como patrón para hallar comillas.