Re: rangeOfString with .RegularExpressionSearch not matching begin and end of line (Swift)

2015-06-12 Thread Douglas Davidson
By default those match beginning and end of string. If you use NSRegularExpression, there's an AnchorsMatchLines option to control this behavior. Douglas Davidson > On Jun 12, 2015, at 3:41 AM, Antonio Nunes wrote: > > Hi, > > I a trying to find a line within a string. When I write: > > le

rangeOfString with .RegularExpressionSearch not matching begin and end of line (Swift)

2015-06-12 Thread Antonio Nunes
Hi, I a trying to find a line within a string. When I write: let match = crashReport.rangeOfString("\nIdentifier:.*\n", options: .RegularExpressionSearch) …I get a match. However, when I write let match = crashReport.rangeOfString(“^Identifier:.*$", options: .RegularExpressionSearch) …which