Here is my String 20161011 , I wanted to get the first String 20161011.
I am using the (^|\\s)([0-9]+)($|\\s)
, however it doesn't work, could someone suggest the correct usage, btw the first String I wanted to retrieve is a date of the format yyyymmdd , I don't need to validate the date format as it comes pre validated.