Case insensitive and pattern matching

This replaces pull request #1751. This is for issue #1724.
Could add something like "Most importantly, remember to escape possible backslashes in the pattern like 'regexp=\\d+'" here and possibly add such pattern also to examples.