[英]Python: Elegant way to check if at least one regex in list matches a string
[英]Python/regex: Elegant way to check if a string contains ONLY numbers and periods
例如,'5243412..32.432242' 會產生 true,而 '2132100345abcdefgh--#$#' 會產生 false。
這個正則表達式
^[0-9\.]*$
匹配僅由數字和句點組成的行。
一個快捷方式是使用 '\d' 檢查數字。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.