Reputation: 31
i want to select all money numbers (red) and this is regex which doesn't work
I can improve regex so that it'll select all numbers ranges like this
May I use some post select regex to remove all dates/time from it? like where it doesn't contain '/' and double '.' and ':'
Upvotes: 0
Views: 96
Reputation: 626806
You may use
\b(?<!\d[:\/.])\d+(?:,\d+)*(?:\.\d+)?(?![.\/:]?\d)
See the regex demo
Regex details
\b
- a word boundary(?<!\d[:\/.])
- no digit + :
, /
or .
allowed immediately to the left of the current location\d+
- 1+ digits(?:,\d+)*
- zero or more occurrences of ,
and 1+ digits(?:\.\d+)?
- an optional occurrence of .
and 1+ digits(?![.\/:]?\d)
- no optional .
, /
or :
followed with a digit are allowed immediately to the right of the current location.Upvotes: 2