str = '{"name": "John", "company": "AB"C corp", "id": "12g: "123 12-12"}'
B"C replace with empty string ''
g: "1 replace with empty string ''
Required string
str = '{"name": "John", "company": "A corp", "id": "1223 12-12"}'
What is the regex for this?
Tried
import re
str = re.sub(r'^[a-zA-Z0-9: "0-9]$', "", str)
Examples:
Valid: '"name": "John"'
Invalid: '"nam"e": "Jo"hn"'
Valid: '"id": "12A"'
Invalid: 'id: "12A"'
str.replace('B"C', '').replace('g: "1', '')?\w: "\wor\w: "\dor[a-z]: "\dor one of the other 50 possible regexes.[A-Za-z][^"]*"\wbut as @Aran-Fey says, the requirements are not clear