I know it can denote range, but for example here [-.\d] seems like this means decimal number. What does dash symbol in front of the regex mean?
Also, why apart from [], are there () around them? What do the () mean?
I know it can denote range, but for example here [-.\d] seems like this
Share
[-.\d]finds one character that is either ([]) a dash (-), a period (.) or a number (\d).The parentheses around mean grouping, so that the matched value can later be accessed using the
group()method of theMatchobject.See also the documentation of the
remodule.