What is regex for currency symbol?

前端 未结 2 1933
滥情空心
滥情空心 2020-12-30 20:58

In java I can use the regex : \\p{Sc} for detecting currency symbol in text. What is the equivalent in Python?

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-30 21:36

    If you want to stick with re, supply the characters from Sc manually:

    u"[$¢£¤¥֏؋৲৳৻૱௹฿៛\u20a0-\u20bd\ua838\ufdfc\ufe69\uff04\uffe0\uffe1\uffe5\uffe6]"
    

    will do.

提交回复
热议问题