MediumParsing
Key=Value Pair Matcher
Write a regex that matches simple configuration lines in the form key=value, where both the key and value consist of word characters only, with exactly one equals sign and no missing sides.
//
name=John / port=8080 / debug=true / invalid key value / =novalue / key=
Test cases
- name=Johnexpect match
- port=8080expect match
- debug=trueexpect match
- invalid key valueexpect no match
- =novalueexpect no match
- key=expect no match
- key==valueexpect no match
How to Solve this Regex Challenge
To complete the Key=Value Pair 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.