Python Forum
use of escape character in re.sub and find
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use of escape character in re.sub and find
#1
Where can I find documentation so that I can learn how to use escape characters in re.sub and with find method correctly?

I tend to find that I always do this by trial and error. I am never sure when to just use "\\" and when to use "\\\\" and how to properly apply the r in front of a pattern.
Reply
#2
python.org documentation here
and here for patterns.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I handle escape character in parameter arguments in Python? JKR 6 1,176 Sep-12-2023, 03:00 AM
Last Post: Apoed2023
  Escape indentation Frankduc 11 3,083 Jan-31-2022, 02:41 PM
Last Post: Frankduc
  add Escape charcters in string GrahamL 3 1,186 Jan-20-2022, 01:15 PM
Last Post: GrahamL
  [solved] unexpected character after line continuation character paul18fr 4 3,431 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  Escape Single quotation between each content tag usman 3 2,820 May-02-2021, 03:32 PM
Last Post: snippsat
  DIY Escape Room for fun StannemanPython 1 2,322 Feb-17-2021, 10:53 PM
Last Post: maurom82
  super newbie question: escape character tsavoSG 3 2,484 Jan-13-2021, 04:31 AM
Last Post: tsavoSG
  How to escape OrderedDict as an argument? Mark17 2 2,033 Dec-23-2020, 06:47 PM
Last Post: Mark17
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,193 Jul-13-2020, 07:05 PM
Last Post: snippsat
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 2,762 Jan-05-2020, 11:50 AM
Last Post: vivekagrey

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020