This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

finding a word in a string?  RSS feed

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i need to find the frequency of hackerrank in a sentence so this program doesnt provide exact output so please help me with the logic?
 
Sheriff
Posts: 57909
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, start by telling us what went wrong. What did you expect, and what happened?
Also explain what your regex is doing.
 
bairava surya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to know the occurrence of hackerrank in the string so help me to write the logic for the pattern ?
 
author
Sheriff
Posts: 23392
138
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

bairava surya wrote:i need to know the occurrence of hackerrank in the string so help me to write the logic for the pattern ?



Let me guess, if that word appears more than once in the string, it is only matched once? If so, here is a hint...

Hint: You are using greedy qualifiers.

Henry
 
bairava surya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my program works single freuency but not works when it apears more than once?
 
Campbell Ritchie
Sheriff
Posts: 57909
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to work out what your regex is doing.
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!