Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regex ignore
#1
I am using a modifier to ignore uppercase and lowercase letters of certain words according to the regular expression below: The regex works but presents the following error: ( DeprecationWarning: Flags not at the start of the expression '^(?!.*SELECT).(?i).*' (truncated)
r"^(?!.*SELECT).(?i).*$", v_path ), Below is the code :

import re
v_path = "index.html/search?id=10"
v_sqli = re.match(
    r"^(?!.*SELECT(?i)).*$", v_path
)
try:
    v_output = v_sqli.string
    print("Security Data")

except(TypeError, AttributeError):
    print("Insecure Data")
Reply
#2
Are you telling about using re.IGNORECASE flag? If so, the code should be something like this:

v_sqli = re.match(r"^(?!.*SELECT(?i)).*$", v_path, re.IGNORECASE)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Ignore WakeWord after it's said Extra 2 1,168 Apr-01-2022, 12:32 AM
Last Post: Extra
  How to ignore "Retrying (Retry(total=2, connect=2, read=5, redirect=5, status=None))" const 3 2,682 Mar-26-2022, 08:55 AM
Last Post: ndc85430
  Ignore first few letters of a line when reading file. ShakeyPakey 16 6,279 May-30-2020, 02:17 PM
Last Post: BitPythoner
  How to ignore empty columns from DB? Winfried 1 2,272 May-15-2020, 08:35 PM
Last Post: menator01
  How to make the script ignore down devices. wagnergt12 4 3,174 Apr-20-2020, 11:45 PM
Last Post: wagnergt12
  Ignore Folder Evil_Patrick 3 3,701 Oct-29-2019, 07:44 AM
Last Post: Gribouillis
  How to ignore formulas when reading excel file SriMekala 3 6,499 Aug-16-2019, 04:04 PM
Last Post: buran
  How to ignore - ERROR: The system was unable to find the specified registry key or va asheru93 9 6,632 Feb-04-2019, 06:35 AM
Last Post: asheru93
  Ignore character in if statement Fizo 6 3,625 Sep-09-2018, 12:39 PM
Last Post: Fizo

Forum Jump:

User Panel Messages

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