HardText Extraction
Unmarked Number Finder
Write a regex that matches whole numbers in a sentence only when they are NOT immediately preceded by a dollar sign, so plain quantities are found but prices are ignored.
//
The price is $100 today / I have 50 apples / $5 discount on 20 items / Total: $9999
Test cases
- The price is $100 todayexpect no match
- I have 50 applesexpect match
- $5 discount on 20 itemsexpect match
- Total: $9999expect no match
- Room 101expect match
- Only $1 leftexpect no match
- just 42expect match
How to Solve this Regex Challenge
To complete the Unmarked Number Finder 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.