I am writing a program in python and have some question (I am 100% new to python):
import re
rawData = '7I+8I-7I-9I-8I-'
print len(rawData)
rawData = re.sub("[0-9]I\+","",rawData)
rawData = re.sub("[0-9]I\-","",rawData)
print rawData
- How to merge the 2 regex into one using
|? It means it will get rid of both9I-and9I+using just one regex operation. - Does len(rawData) return the length of rawData is byte?
Thank you.
"[0-9]I[+-]"