encode uri. use math.js proper regexp for expressions