EasyText Extraction
Digit Sequence Extractor
Write a regex that detects whether a piece of text contains a run of one or more digits, so it could be used to pull numbers like order counts or prices out of a sentence.
Solved! All test cases pass.
//
Order 12 items, Price: 100, no numbers here, abc123def
Test cases
- Order 12 itemsexpect match
- no numbers hereexpect no match
- Price: 100expect match
- (empty)expect no match
- abc123defexpect match
- only lettersexpect no match
How to Solve this Regex Challenge
To complete the Digit Sequence Extractor 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.