[Solved] Replace [1-2] in to 1 in Python
You could use a regex like: ^(.*)\[([0-9]+).*?\](.*)$ and replace it with: $1$2$3 Here’s what the regex does: ^ matches the beginning of the string(.*) matches any character any amount of times, and is also the first capture group\[ matches the character [ literally([0-9]+) matches any number 1 or more times, and is also the second … Read more