简体   繁体   中英

how get only the full matched string from regular expression

/[-+]?\\d+([,.]\\d+)*/gm

test:
156,1651,5e6116

if i use the above string for test it is selecting partially. how to get only the full matched string ? i'm using the above regex for Javascript

/^[-+]?\d+([,.]\d+)*$/gm

使用anchor ^$仅获得完全匹配,而不是部分匹配。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM