Hi all,
I am looking to use the {=extractregexall({site:text})} to identify the total number of defined keywords on a site page. I have been able to successfully do this at a basic level (I'm sure my current method could be refined), however, I am seeing if there is a way to condense the results into a formmenu and then sort() the words based on the total sum of each result while maintaining the association between the word+number (e.g. sort() the number of times specific words appears on a page. "Cats: 3", "Dogs: 5", "Lizards: 7" > "Lizards: 7", "Dogs: 5", "Cats: 3").
Any suggestions on sorting these items inside a formmenu? Would I need to create a list to do this? If so, how would I format it?
Example:
{Identify=extractregexall({site: text}, "Public reply\n([\s\S]+)\nUser Data")}
{formmenu: name=keywords; default=;Cat: {=Cats}; Dog: {=Dogs}; Lizard: {=Lizards}}
Cat: {a1=extractregexall({=Identify}, "Cat")}{a2=extractregexall({=Identify}, "cat")}{Cat1=count(a1)}{Cat2=count(a2)}{Cats=sum([Cat1, Cat2])} {=Cats}
Dog: {a1=extractregexall({=Identify}, "Dog")}{a2=extractregexall({=Identify}, "dog")}{Dog1=count(a1)}{Dog2=count(a2)}{Dogs=sum([Dog1, Dog2])} {=Dogs}
Lizards: {a1=extractregexall({=Identify}, "Lizards")}{a2=extractregexall({=Identify}, "lizards")}{Lizards1=count(a1)}{Lizards2=count(a2)}{Lizards=sum([Lizards1, Lizards2])} {=Lizards}