node module: build a regex from user input for filtering data