MediumParsing
Simple HTML Tag Matcher
Write a regex that detects simple HTML tags like <div>, <p>, or a closing </span>, without worrying about attributes inside the tag.
Need a syntax reminder? Read our detailed guide on the Simple HTML Tag Matcher Regex Pattern.
Solved! All test cases pass.
//
<div>Hello</div> / <p> / </span> / no tags here / <3 you / <>
Test cases
- <div>Hello</div>expect match
- <p>expect match
- </span>expect match
- no tags hereexpect no match
- <3 youexpect no match
- <>expect no match
How to Solve this Regex Challenge
To complete the Simple HTML Tag Matcher challenge, you must write a regular expression pattern that satisfies all specified test cases.
Steps to Complete:
- Analyze the Requirements: Read the description and review the list of test cases below. Identify which strings must be matched (green markers) and which must be rejected (red markers).
- Draft Your Pattern: Enter your regex in the interactive editor. Use the provided Hint button if you get stuck.
- Verify: The test cases panel will update in real-time as you type, showing which strings match your current expression.
- Review the Solution: Once you successfully pass all test cases, review the explanation to understand the logic behind the solution.