Regular expression for validating name
You’ll implement this highlighting functionality at the very end of the tutorial.
Your first step to getting the search functionality to work is to turn standard strings representing regular expressions into presents this view controller modally and allows the user to enter his or her search (and optional replace) terms, as well as specifying whether the search should be case sensitive or match only whole words.
Mapping is of course somewhat expensive, but the numbers we were seeing were way higher than expected: mapping was ridiculously slow!
Take a look at the and calculates the range of the entire string.
It’s possible to apply a regular expression to just a part of your text, which is why you need to specify the range.
But before we benchmark: let’s look at the solution candidates first.
To be able to compare results, we decided on a baseline for our benchmark.