Fixed creation of RegExp with special characters.

Changers done include the following:
- Before creating a new regular expression, escaping the text which
might contain special characters.
- The property to be matched and picked up can now be an array as well.
- Optimized the code while marking all items. Fetching only the items
that matter.