Skip to content
Alex edited this page Nov 20, 2013 · 2 revisions

PHP 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.

Selecting Links

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:
Hand
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.
eBay3Urls
When we thing we have enough links to make the regex, we click on the stop button:
stop
Now 3 actions will happend:

  1. The suggested regex will be placed in the text box area
  2. The regex will be executed and this will be hightlight every link that match the regex
  3. The results tab will be expanded, showing the results of the match in a table
    EbayResults

In this case, we have been lucky and we have catch every ad url in the site

Selecting More Links

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.

Making A New Selection

If you want to start again it's not necessary to refresh the site. Just click on the refresh button:
Refresh Button

Too Many Results

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:
Join 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

One More Option

If none of this worked, you can try your own regex. Just put it on the textbox, and press Enter.