/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] need suggsestions … returning number that a certain word appears in a textarea

Ok, first let me say that I am still learning javascript and am by no means close to being a “Guru” ? .

Thus, my quandry. I have a form set up with a textarea. What I need is a script that will count the number of times a certain set of characters appear in the textarea.

To be a bit more clear, I need to find, for instance, all occurances of <b> and then check to see if there is a matching set of </b> tags.

I know this can be done. However, I am just not sure where to start nor which direction to go with it.

Any suggestions are much appreciated.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@mrhooAug 27.2006 — [CODE]String.prototype.hasAny=function(rx){
if(typeof(rx)=='string') rx=RegExp(rx,'g');
var M= this.match(rx);
return (M)? M.length: 0;
}[/CODE]
Copy linkTweet thisAlerts:
@stngr2112authorAug 27.2006 — Didnt use that method but have it working now. Thanks mrhoo!
×

Success!

Help @stngr2112 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...