i want to match a known number(floating point or integer) with a string and finding number of that repeat.
like match 22 in “22.5 98 12 22 322”
how i can do it with regular expression ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
returns number of occurrences of “substr” in “str”. For example:
If you want to match integers rather than just substrings, make sure the number is preceded and followed by a space:
Another option, without regular expressions: