Python Forum
Python Regular expression, small sample works but not on file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Regular expression, small sample works but not on file
#3
(Jun-09-2021, 01:43 PM)Gribouillis Wrote: When re.search() doesn't find a match, the returned object is None instead of a match object.

Thank you @Gribouillis
Yes, you are right, but that is the help, I need as if the sample size is small, I get the right result, both in python editors and regular expressions online. regex https://regex101.com/
I tried to use findall as well but same result, if I take small sample, I get result but when I give entire page source to pull out the list, I get blank.
I have attached the regular expression result. You can find the same strings in the sample file.

Attached Files

Thumbnail(s)
       
Reply


Messages In This Thread
RE: Python Regular expression, small sample works but not on file - by Acernz - Jun-09-2021, 02:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Search in a file using regular expressions ADELE80 2 725 Dec-18-2024, 12:29 PM
Last Post: ADELE80
  Regular expression help anilrajr 4 1,763 May-08-2024, 06:18 PM
Last Post: deanhystad
  data validation with specific regular expression shaheen07 0 869 Jan-12-2024, 07:56 AM
Last Post: shaheen07
  Python beginner that needs an expression added to existing script markham 1 1,372 Sep-04-2023, 05:24 AM
Last Post: Pedroski55
  Recursive regular expressions in Python risu252 2 5,090 Jul-25-2023, 12:59 PM
Last Post: risu252
  Regular Expression search to comment lines of code Gman2233 5 2,839 Sep-08-2022, 06:57 AM
Last Post: ndc85430
  List Creation and Position of Continue Statement In Regular Expression Code new_coder_231013 3 2,672 Jun-15-2022, 12:00 PM
Last Post: new_coder_231013
  Convert nested sample json api data into csv in python shantanu97 3 5,361 May-21-2022, 01:30 PM
Last Post: deanhystad
  Need help with my code (regular expression) shailc 5 2,940 Apr-04-2022, 07:34 PM
Last Post: shailc
  Regular Expression for matching words xinyulon 1 2,760 Mar-09-2022, 10:34 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