-
Notifications
You must be signed in to change notification settings - Fork 1
Suggesting Regex
The First thing I want to say, is that this addon suggests PHP regex because is the language that it's usefull for me. Internally uses JS regex, so an extra option in the future could be the change of the response languange.
First thing we are going to do is once we are in the right site (E.g: http://www.ebay.es/sch/Ropa-Zapatos-y-Complementos-/11450/i.html) is to click on the hand button:
Now we can click on a couple (or three or four...) of links we want to use to make our regex.
You can see that they are going to be highlighted.
When we thing we have enough links to make the regex, we click on the stop button:
Now 3 actions will happend:
- The suggested regex will be placed in the text box area
- The regex will be executed and this will be hightlight every link that match the regex
- The results tab will be expanded, showing the results of the match in a table
In this case, we have been lucky and we have catch every ad url in the site
Maybe the regex has taken the 60% of the links we want. In that case, we are going to repeat the last procedure adding some extra links that are not hightlighted yet. Don't worry, the elements you previously selected will still be used to make the regex.
If you want to start again it's not necessary to refresh the site. Just click on the refresh button:
Another case is when the regex finds too many results, for instance this could happen with duplicated links. In this case we are going to try to find some common pattern before the selected links by clicking this button:
This can turn a regex like:
@<a [^>]*href="http://www\.ebay\.es/[^"]*"[^>]*>.*</a>@isU
Into a regex like:
@<h2[^>]*>\s*<a [^>]*href="http://www\.ebay\.es/[^"]*"[^>]*>.*</a>@isU
If none of this worked, you can try your own regex. Just put it on the textbox, and press Enter.