I'm trying to extract date, percentage or number from string. Strings can be:
- the response value 10 (from here I want to extract 10)
- the response value 10/12/2014 (from here I want to extract 10/12/2014)
- the response value 08/2015 (from here I want to extract 08/2015)
I've written regex as (?:\d{2}\/\d{4}|\d{2}(?:\/\d{2}\/\d{4})?)
Regex is satisfying 12/12/2014, 10, 02/2012.
I'm also trying to modifying same regex to get 10, 08/2015 and 10/10/2015 but not getting how to get.
How can this be achieved?