gpt4 book ai didi

python /正则表达式 : Elegant way to check if a string contains ONLY numbers and periods

转载 作者:太空宇宙 更新时间:2023-11-04 03:32:12 25 4
gpt4 key购买 nike

例如,“5243412..32.432242”会产生 true,而“2132100345abcdefgh--#$#”会产生 false。

最佳答案

这个正则表达式

^[0-9\.]*$

匹配仅由数字和句点组成的行。

关于 python /正则表达式 : Elegant way to check if a string contains ONLY numbers and periods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30672194/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com