global SEARCH command

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
artb
Posts: 3
Joined: Tue Aug 11, 2009 4:50 pm

global SEARCH command

Post by artb » Tue Apr 13, 2010 3:12 am

Can iMacros for Firefox handle global regex searches and assign the matches to EXTRACT?
For example, can I use the search command and write a regex that searches out all words in the SOURCE that have the letter "q" in them no matter where those words are on the page, and then assign every word with the letter "q" to the EXTRACT variable? So then if I were to PROMPT the EXTRACT, it would show "quack quo queen equal equate equador".
I attempted to make my regex global by adding "\g" on the end, but that didn't work in the imacros. I get an error. Without the "\g", I only get the first occurrence of a word with "q" in it showing up in EXTRACT.
Is there another way to write a global search?
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: global SEARCH command

Post by Daniel, Tech Support » Fri Apr 16, 2010 3:25 pm

Hi,

The SEARCH command doesn't support the global option. It will only find the first occurrence of the word. In case you need all of them, you could extract the whole HTML (TYPE=BODY ... EXTRACT=HTML) and get the values you need with JavaScript.

Best regards,
Daniel, iOpus Support
Post Reply