내 목표는, 문자열과 장소 적 정수 또는 16 진수를 찾을 수 읽기와 그것을 대체하는 다른 문자열은 "[0-9]" 내 문자열 :진수에 대한 정규 표현식과
a = hello word 123 with the 0x54673ef75e1a
a1 = hello word 123 with the 0xf
a2 = hello word 123 with the 0xea21f
a3 = hello word 123 with the 0xfa
b = re.sub(r"(\d+[A-Fa-f]*\d+[A-Fa-f]*)|(\d+)","[0-9]",a)
을 다음과 같은 출력 가져 오기 :
hello word [0-9] with the [0-9]x[0-9]a
hello word [0-9] with the [0-9]xf
hello word [0-9] with the [0-9]xea[0-9]
hello word [0-9] with the [0-9]xfa
그러나 outpu를 다음과 같이 시도 해 봤나 t는 것과 같아야합니다 :
hello word [0-9] with the [0-9]
hello word [0-9] with the [0-9]
hello word [0-9] with the [0-9]
hello word [0-9] with the [0-9]
http://ideone.com/nMMNJm가 'R'(\ D + 0X [A-FA-F의 \의 D를] +) '를 이용하여 시도를 참조. – Blender