简体   繁体   中英

RegEx to match a single digit followed by a “.” followed by another single digit

I am trying to find the RegEx in use with the preg_match function for a single digit followed by a "." followed by a single digit.

Example:

3.3 valid 44.4 invalid but would capture 4.4 4.664 invalid but would capture 4.6

this regex should help you:

\\d{1,1}[\\.]{1}\\d{1,1}

you can try other regex at this site

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