Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deny backslash using regex
#2
You have probably typed or copied that string yourself.
When it parsed or coming other placed from python it will be \\:
v_char = "search?q=\\"
This is because of escape character,so python read it as one \.
Will see this if use print().
>>> v_char = "search?q=\\"
>>> v_char 
'search?q=\\'
>>>
>>> print(v_char)
>>> search?q=\
Reply


Messages In This Thread
Deny backslash using regex - by JohnnyCoffee - Mar-18-2020, 05:25 PM
RE: Deny backslash using regex - by snippsat - Mar-18-2020, 10:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  change backslash into slash in a path paul18fr 7 2,474 Jul-21-2022, 04:26 PM
Last Post: deanhystad
  converting backslash codes Skaperen 4 5,501 Apr-21-2018, 04:07 AM
Last Post: Skaperen
  Reading and writing Windows filepath without treating backslash as escape character Dangthrimble 3 3,561 Dec-18-2017, 06:18 PM
Last Post: DeaD_EyE
  Replace Single Backslash with Double Backslash in python saswatidas437 2 33,416 Mar-19-2017, 10:48 AM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

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