Re: [Clip] Count Occurrences Command
- Art Kocsis (artkns@...) wrote (in part) (on 2009-09-08 at
> Is there any command or RegEx that will count the occurrence of aHi Art:
> similar to the 'Count Occurrences" checkbox of the Find & Replace
> command? Obviously I could write a clip to accomplish this but I am
> for a single line statement. All of the option of the toolbar command
> replicated in the clip command except this one.
> ^$GetDocListAll("SearchPattern";"ReplaceString")$ (added in v5.7)Not tested but there s/b some way to turn the captured string into an
> Finds all matching strings in the current document (or selected text)
> based on the SearchPattern regexp pattern. The function returns a
> string with each match formatted according to the ReplaceString. See
> the Substring Replacements page in the separate Regex.chm help file
> for ReplaceString details.
> Example that collects and displays all URLs in a Web page:
> ^!Info [L]^$GetDocListAll("(?s)<a.+?href\s*?=\s*?"(.*?)"";"$1\r\n")$
array and check the zero element - or more simply just replace all
occurrences by (say) "#" and then do ^$StrSize("Str")$ on the result.
Regards ... Alec (buralex@gmail & WinLiveMess - alec.m.burgess@skype)
[Non-text portions of this message have been removed]