Skip to content
murmot

Results for “python string replace regular expression function site:mail.python.org”

  • mail.python.org

    [Tutor] regular expressions

    Again, this is too vague. Show us exactly what you tried and what result you got. BTW you don't need the re module to replace fixed strings with new strings, you can use the replace() method of the string

  • mail.python.org

    [Tutor] Regular expression questions

    Once again struggling with regular expressions. I have a string that look like "something_shp1". I want to replace "_shp1" by "_shp". I'm never sure if it's going to be 1, if there's going to be a number after "_shp". So I'm trying to use regular expression to perform this replacement.

  • mail.python.org

    [Tutor] Regular expression questions

    Once again struggling with regular expressions. > > I have a string that look like "something_shp1". > I want to replace "_shp1" by "_shp".My second question is related more to the actual string replacement. > Using regular expressions, what would be the way to go?