From: Joseph Spiros Date: Mon, 2 Mar 2009 06:13:48 +0000 (-0500) Subject: Fixed word wrap regular expression. X-Git-Tag: v1.0~1 X-Git-Url: http://git.ithinksw.org/GrowlITTSW.git/commitdiff_plain/c657060277c9ae1ddd7aae9bd5d8ec77fbabec28 Fixed word wrap regular expression. --- diff --git a/GrowlITTSWController.m b/GrowlITTSWController.m index b5c762b..1cd4265 100644 --- a/GrowlITTSWController.m +++ b/GrowlITTSWController.m @@ -132,7 +132,7 @@ } if (_wrapNotifications) { - text = [text stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"(.{1,%i})(?: +|$)\\n?|(.{%i})", _wrapColumns, _wrapColumns] withString:@"$1$2\n"]; + text = [text stringByReplacingOccurrencesOfRegex:[NSString stringWithFormat:@"(\\S\\S{%i,}|.{1,%i})(?:\\s+|$)", _wrapColumns, _wrapColumns] withString:@"$1\n"]; } //trim trailing whitespace