Python is a great scripting language. www.python.org
Al Sweigart wrote great Python books;
Automate the boring tasks with Python
https://automatetheboringstuff.com/
Read his books online or buy his books. I have all of his books!
http://inventwithpython.com/
Regular expressions allow you to specify patterns of text to search for.
www.regular-expressions.info is a good resource.
Happy coding.