- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to write Python regular expression to get all the anchor tags in a webpage?
The following code extracts all tags in the given string
import re rex = re.compile(r'[\<\>]') l = "this is text1 <a href='irawati.com' target='_blank'>hi</a> this is text2" print rex.findall(l)
['<', '>', '<', '>']
- How to write a Python regular expression to get numbers except decimal?
- How to write a Python regular expression to use re.findall()?
- How to write a Python Regular Expression to validate numbers?
- How to write Python regular expression to get zero or more occurrences within the pattern?
- How to write Python regular expression to check alphanumeric characters?
- How to write a case insensitive Python regular expression without re.compile?
- How to write a Python regular expression to match multiple words anywhere?
- How to write Python Regular Expression find repeating digits in a number?
- How to write Python regular expression to match with file extension?
- How to write a regular expression to match either a or b in Python?
- How to write a Python regular expression that matches floating point numbers?
- How can I find all matches to a regular expression in Python?
- How to get the number of capture groups in Python regular expression?