the script I'm writing needs to count the number of matching "strings" in clipboard.
so how do I search the contents of the clipboard and return the number of matches for a string eg number of times "green rabbit" appears in the clipboard.
Thanks

Moderators: JRL, Dorian (MJT support)
Code: Select all
GetClipBoard>strText
Separate>strText,green rabbit,item
Sub>item_count,1
MDL>%item_count% "green rabbit" found
Code: Select all
GetClipBoard>strText
LowerCase>strText,lower_strText
Separate>lower_strText,green rabbit,item
Sub>item_count,1
MDL>%item_count% "green rabbit" found
Code: Select all
GetClipBoard>strText
//Case In-Sensitive match
Let>pattern=green rabbit
//Case Sensitive match
//Let>pattern=(?-i)green rabbit
RegEx>pattern,strText,0,matches,num,0
MDL>%num% "%pattern%" found