FlyerTalk Forums - View Single Post - ITA-Matrix-PowerTools - Userscript for Orbitz/DL/UA/AA/BA/CZ/IB/LA/LH/LX/TK
Old Nov 1, 2014 | 2:43 pm
  #7  
Steppo
 
Join Date: Jun 2013
Location: Somewhere between if and else
Posts: 142
Nice idea! ^
I did some work and added support for the german version of ita.
Give it a try
Code:
changed
var re=/(strong)*\>[A-Za-z\s/\,\.]*\((\w\w\w)\)[^\(]*\((\w\w\w)\)/g;
to
var re=/(strong)*\>[^\(\>]*\((\w{3})[^\(]*\((\w{3})/g;
changed
var re=/(strong)*\>[A-Za-z\s\/\,\.]*\(\w\w\w\)[A-Za-z\s\/\,\.]*\(\w\w\w\)\s*\-\s*\w*\,\s*(\w\w\w)\s([0-9]*)/g;
to
var re=/(strong)*\>[^\(\>]*\(\w{3}[^\(]*\(\w{3}[^\,]*\,\s*([a-zA-Z0-9]{1,3})\.?\s*([a-zA-Z0-9ä]{1,3})/g;
and much more...
You can find it here:
https://gist.github.com/anonymous/59fa19f78289571b9a49
Warning: Github is messing up special-chars like ü & ä in raw mode... what a pity

----- Edit ----
To deal with something like:
Scandinavian Airlines System (SAS) 903
you need
Code:
//Find Airports
var re=/(strong)*\>[^\(\<]*\((\w{3})[^\(\<]*\((\w{3})/g;
and
//Find Date
var re=/(strong)*\>[^\(\>]*\(\w{3}[^\(\<]*\(\w{3}[^\,]*\,\s*([a-zA-Z0-9]{1,3})\.?\s*([a-zA-Z0-9ä]{1,3})/g;
https://gist.github.com/anonymous/9261bd7620a4e246e63f

Last edited by Steppo; Nov 1, 2014 at 6:43 pm Reason: Github Raw
Steppo is offline