• Viernes 19 de Abril de 2024, 11:06

Autor Tema:  Duda con Regexp  (Leído 1447 veces)

Malik

  • Nuevo Miembro
  • *
  • Mensajes: 23
    • Ver Perfil
Duda con Regexp
« en: Miércoles 18 de Marzo de 2009, 18:15 »
0
Tengo esto:
Código: Python
  1.  
  2. return re.sub(r"(d{3}B)", r"1,", str(number)[::-1])[::-1]
  3.  
  4.  

De ahí no entiendo esto:
B

y el 1 de r"1,"

¿Alguien puede explicarme que representa eso? He buscando infor por google pero no logro aclarar la duda.

thanks!!!

su -

  • Moderador
  • ******
  • Mensajes: 2349
    • Ver Perfil
Re: Duda con Regexp
« Respuesta #1 en: Miércoles 18 de Marzo de 2009, 20:47 »
0
Cita de: "docs.python.org"
B
    Matches the empty string, but only when it is not at the beginning or end of a word. This is just the opposite of b, so is also subject to the settings of LOCALE and UNICODE.
http://docs.python.org/library/re.html
*******PELIGRO LEE ESTO!!*******

There is no place like 127.0.0.1

Conecto luego existo, no conecto luego insisto.

Malik

  • Nuevo Miembro
  • *
  • Mensajes: 23
    • Ver Perfil
Re: Duda con Regexp
« Respuesta #2 en: Martes 28 de Abril de 2009, 06:04 »
0
Gracias por el enlace, su.

Lo dejé un poco abandonado esto de python por falta de tiempo, pero en breve vuelvo a darle caña :)

Un saludo