I want to find all the force unwrapped variables in my Xcode project. For example anything that's similar to:
variableName! : otherVariable
This one will search for only valid variable names (alphanumeric strings starting with a letter) that are followed by an
! which is then followed by a space, tab, newline, or a period, comma, or colon. This search also excludes finding instances of
This next pattern will match
as! if you are interested in finding those as well.
It should be noted both of these patterns will also match for variable types that are force unwrapped optionals (a common variable to be force unwrapped being
A really good resource for writing and testing regular expressions is regexr.com