Help with SEARCH SOURCE=REGEXP

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
DigitAlDog
Posts: 2
Joined: Sun Dec 19, 2010 7:20 am

Help with SEARCH SOURCE=REGEXP

Post by DigitAlDog » Sun Dec 19, 2010 7:35 am

Sorry I'm still a bit of a noob, but I'm pulling my hair out here trying to get this to work right, hoping someone here can help me. I'm trying to search source but I can't figure out how to get the extract right.

This is my imacros code I come up with

Code: Select all

SEARCH SOURCE=REGEXP:"answer == \"([^']+)"\" EXTRACT="$1"
Here is the line from the source page I'm extracting from

Code: Select all

if(answer == "five" || answer == "FIVE" || answer == "Five" || answer == 5) {
This is the result from my script I get in my prompt

Code: Select all

five" || answer == "FIVE" || answer == "Five
How do I get just five or 5 to show in the prompt?
siniy
Posts: 118
Joined: Sat Nov 07, 2009 7:44 pm

Re: Help with SEARCH SOURCE=REGEXP

Post by siniy » Sun Dec 19, 2010 10:50 am

You almost got it.With the regex below I'm getting 'five'

Code: Select all

SEARCH SOURCE=REGEXP:"answer == \"([^\"]+)\"" EXTRACT="$1"
I'd reccomend develop regexes for imacros in external tool. I use "Regex coach".
DigitAlDog
Posts: 2
Joined: Sun Dec 19, 2010 7:20 am

Re: Help with SEARCH SOURCE=REGEXP

Post by DigitAlDog » Sun Dec 19, 2010 2:19 pm

Thanks siniy, works perfect. I see what ya done there, I'm still learning a little bit at a time.
Post Reply