Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I want to make a Batch Processor (so as to run multiple Regex one by one, in the order I put them). I give you 3 examples, but In the BatchProcessor PY script I will have more than 20 regex (find and replace) to run.
- There are 3 types of search and Replace that you must consider:
- 1. The simple search: -----------------
- FIND: Abracadabra, Who Are You
- Replace by: Everythin you want
- 2. The simple regex search: -----------------
- FIND: <title>.*\K\|(.*)(</title>)
- Replace by: \x20|\x20Something Else \(zh\)\x20\2
- 3. The regex search (with .matches newsline) -----------------
- FIND: (<link rel="canonical" href="(.*?)" />.*?)(<meta property="og:url" content=").*?("\/>)
- Replace by: \1\3\2\4
- -----------HTML CODE FOR TESTING THESE REGEX, (copy thie line exatly how they are in some new txt file)----
- <title>Abracadabra, Who Are You?| Neculai Fantanaru (en)</title>
- <link rel="canonical" href="https://neculaifantanaru.com/fr/abracadabra-qui-etes-vous.html" />
- <meta name="keywords" content="abracadabra, qui êtes-vous?"/>
- <meta property="og:url" content="MAMA.html"/>
- ----------------------------------------------
- ---Maybe will help you this----
- https://mail.python.org/pipermail/python-ideas/2010-March/006897.html
- https://www.geeksforgeeks.org/pattern-matching-python-regex/
- https://www.codeproject.com/Tips/5280511/Regexplus-Extended-Regular-Expression-Engine
Add Comment
Please, Sign In to add comment