Sorry if this is a easy question. Is there a regex to validate if four continuous characters in a String are numbers(for a year for example)?
For example glorer1891kl -> true,
74djada -> false
i need to validate if in the string exist four continuous characters, each character is a number.
[0-9]{4}
will do it. There’s a great website for testing this….
http://gskinner.com/RegExr/