Does “\d” in regex mean a digit?

前端 未结 6 1192
天命终不由人
天命终不由人 2020-11-22 14:16

I found that in 123, \\d matches 1 and 3 but not 2. I was wondering if \\d matches a digit sati

6条回答
  •  孤街浪徒
    2020-11-22 14:46

    [0-9] is not always equivalent to \d. In python3, [0-9] matches only 0123456789 characters, while \d matches [0-9] and other digit characters, for example Eastern Arabic numerals ٠١٢٣٤٥٦٧٨٩.

提交回复
热议问题