Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pyhton regex to find string in file

  # Open file
  f = open('test.txt', 'r')
  # Feed the file text into findall(); it returns a list of all the found strings
  strings = re.findall(r'some pattern', f.read())
Source by developers.google.com #
 
PREVIOUS NEXT
Tagged: #pyhton #regex #find #string #file
ADD COMMENT
Topic
Name
4+2 =