re.findall(r'^PY (\d\d\d\d)', wosrecords, flags=re.MULTILINE)
should work
More Related Contents:
- How to use a variable inside a regular expression?
- Match a whole word in a string using dynamic regex
- How to check for valid email address? [duplicate]
- Case insensitive regular expression without re.compile?
- Python string.replace regular expression [duplicate]
- Split a string at uppercase letters
- Regex matching 5-digit substrings not enclosed with digits
- How to split but ignore separators in quoted strings, in python?
- Python regex match OR operator
- Regular expression to extract URL from an HTML link
- BeautifulSoup – search by text inside a tag
- Python Regex escape operator \ in substitutions & raw strings
- How to extract an IP address from an HTML string?
- Get the string within brackets in Python
- Regex for existence of some words whose order doesn’t matter
- Split string based on a regular expression
- Split string on commas but ignore commas within double-quotes?
- Python/Regex – How to extract date from filename using regular expression?
- How would I get everything before a : in a string Python
- Python regex: splitting on pattern match that is an empty string
- How to remove symbols from a string with Python? [duplicate]
- Python – Locating the position of a regex match in a string?
- How to find and replace nth occurrence of word in a sentence using python regular expression?
- Python unicode regular expression matching failing with some unicode characters -bug or mistake?
- How to split a string by commas positioned outside of parenthesis?
- Regex to match digits of specific length
- Regex: match only outside parenthesis (so that the text isn’t split within parenthesis)?
- Faster way to remove stop words in Python
- Why doesn’t Python’s `re.split()` split on zero-length matches?
- Regular expression that finds and replaces non-ascii characters with Python