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
  Warning - ' invalid escape sequence '\s'' tester_V 4 29,257 Aug-08-2024, 04:58 PM
Last Post: tester_V
  How do I handle escape character in parameter arguments in Python? JKR 6 5,219 Sep-12-2023, 03:00 AM
Last Post: Apoed2023
  Escape indentation Frankduc 11 4,803 Jan-31-2022, 02:41 PM
Last Post: Frankduc
  add Escape charcters in string GrahamL 3 1,860 Jan-20-2022, 01:15 PM
Last Post: GrahamL
  [solved] unexpected character after line continuation character paul18fr 4 6,487 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  Escape Single quotation between each content tag usman 3 3,601 May-02-2021, 03:32 PM
Last Post: snippsat
  DIY Escape Room for fun StannemanPython 1 3,820 Feb-17-2021, 10:53 PM
Last Post: maurom82
  super newbie question: escape character tsavoSG 3 3,233 Jan-13-2021, 04:31 AM
Last Post: tsavoSG
  How to escape OrderedDict as an argument? Mark17 2 2,646 Dec-23-2020, 06:47 PM
Last Post: Mark17
  SyntaxError: unexpected character after line continuation character siteshkumar 2 4,120 Jul-13-2020, 07:05 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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