How to test characters of a string

Christian Gollwitzer auriocus at gmx.de
Tue Jun 7 18:04:44 EDT 2022


Am 07.06.22 um 23:01 schrieb Christian Gollwitzer:

>> In [3]: re.sub(r'^\d+\s*', '', s) Out[3]: 'Trinket'
>>

that RE does match what you intended to do, but not exactly what you 
wrote in the OP. that would be '^\d\d.'  start with exactly two digits 
followed by any character.

	Christian


More information about the Python-list mailing list