How to count the no. Of occurrence of a particular pattern of String in the sentence? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to count the no. Of occurrence of a particular pattern of String in the sentence?

Use any language to get the count of pattern search

6th Mar 2018, 7:02 PM
Sixth Sense
Sixth Sense - avatar
4 Answers
+ 5
Of course, that's mainly what RegEx are all about. Just try the link above, paste your text in one window and check your pattern in another.
7th Mar 2018, 7:42 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 4
Regular expressions or RegEx are specifically thought of dealing with such tasks. If you want to try out a proper syntax, I can recommend: http://www.regex101.com to prototype the adequate RegEx query in your language of choice.
6th Mar 2018, 8:07 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
7th Mar 2018, 6:29 PM
Sixth Sense
Sixth Sense - avatar
0
I wanted to try this on normal sentence with all punctutation...is it possible? @Kuba Siekierzynski
7th Mar 2018, 6:33 PM
Sixth Sense
Sixth Sense - avatar