update algorithms, use regex