I’m trying to count the instances of a certain word on a webpage. What I’d like to do is close any tab with more than two instances of that word, so I THINK I need to:
copy the contents of the page into a named clipboard
search the content of that named clipboard for WORD
set variable wordCount to the number of instances
IF: wordCount >2, close tab.
The problem is, I don’t know how to accomplish steps 2 and 3. How can I accomplish this?
Thank you, this works great. Is there a source you’d recommend to learn some of basics of regular expressions? I’d like to be able to tinker with it next time before running to the forums.
Thank you. It is very interesting so far. http://regexr.com/ has been useful for kluding my way through the simple things I want to do so far Bookmarking your post for future reference.
Good you you for sticking with it! I found that when I started using regex’s whenever possible, I learned more quickly. So I use them in various editors to find things. Helps a lot.