(\\d+|) vs (\\d+)?[\\w\\W] vs [\\d\\D] vs .Is there any difference between t
[\w\W] and [\d\D] are used in languages like JavaScript in which there isn't a dotall option.
It matches all characters, including newlines, unlike . which matches everything but a newline.
\w\W or \d\D -> matches everything including newline characters
. -> matches everything except newline characters unless
's' (dotall modifier) is specified
(\d+|) or (\d+)? -> matches 1 or more digits OR any position (null)
It could simply be written as '(\d*)'