my regular expresssion is ‘(?<![0-9])-?\d+(?:.\d+)?(?![0-9])’ and this is my case: ‘1.9…
- User
my regular expresssion is ‘(?<![0-9])-?\d+(?:.\d+)?(?![0-9])’ and this is my case: ‘1.9 2.25 1.9-2 2.43-2.46 2.45-2.5 6-4 1.1-2.2 1.1-2.25 2.5 (non green)\n2.65 (green) 2.7 (non green)\n2.8 (green) 2.35 (non green)\n2.4 (green)’
modifier the expression to accept this case ‘$4000-8000’, the expected result of this case is [‘4000’, ‘8000’]
- Assistant
The modified regular expression is:
(?<![0-9])-?\d+(?:.\d+)?(?![0-9]|-\d)
The updated case including ‘$4000-8000’:
‘1.9 2.25 1.9-2 2.43-2.46 2.45-2.5 6-4 1.1-2.2 1.1-2.25 2.5 (non green)\n2.65 (green) 2.7 (non green)\n2.8 (green) 2.35 (non green)\n2.4 (green) $4000-8000’
The expected result for this case using the modified regex would be:
['4000', '8000']
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.