mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-04 09:53:41 +00:00
Merge pull request #2505 from HTPC-Schrauber/fix-RegEx
Fixed: RegEx for gcc > 4.9
This commit is contained in:
@@ -1899,18 +1899,18 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
|
||||
+ (JSObject)_wordBoundaryRegex
|
||||
{
|
||||
return /(^[0-9][\.,])|(^.[^-\.,+#'"!§$%&/\(<\[\]>\)=?`´*\s{}\|¶])/m;
|
||||
return new RegExp("(^[0-9][\\.,])|(^.[^-\\.,+#'\"!§$%&/\\(<\\[\\]>\\)=?`´*\\s{}\\|¶])", "m");
|
||||
}
|
||||
|
||||
+ (JSObject)_paragraphBoundaryRegex
|
||||
{
|
||||
return /^.[^\n\r]/m;
|
||||
return new RegExp("^.[^\\n\\r]", "m");
|
||||
}
|
||||
|
||||
+ (JSObject)_whitespaceRegex
|
||||
{
|
||||
// do not include \n here or we will get cross paragraph selections
|
||||
return /^.[ \t]+/m;
|
||||
return new RegExp("^.[ \\t]+", "m");
|
||||
}
|
||||
|
||||
- (CPRange)_characterRangeForIndex:(unsigned)index asDefinedByRegex:(JSObject)regex
|
||||
|
||||
@@ -350,7 +350,7 @@ var kRgsymRtf = {
|
||||
|
||||
var hex = '';
|
||||
|
||||
while (/[a-fA-F0-9\']/.test(ch))
|
||||
while (new RegExp("[a-fA-F0-9\\']").test(ch))
|
||||
{
|
||||
if (ch == "'")
|
||||
{
|
||||
@@ -377,7 +377,7 @@ var kRgsymRtf = {
|
||||
|
||||
var code = '';
|
||||
|
||||
while (/[0-9]/.test(ch))
|
||||
while (new RegExp("[0-9]").test(ch))
|
||||
{
|
||||
code += (ch + '');
|
||||
ch = _rtf.charAt(++_currentParseIndex);
|
||||
@@ -621,7 +621,7 @@ var kRgsymRtf = {
|
||||
if (!/[a-zA-Z]/.test(ch))
|
||||
return [self _translateKeyword:ch parameter:nil fParameter:fParam];
|
||||
|
||||
while (/[a-zA-Z]/.test(ch))
|
||||
while (new RegExp("[a-zA-Z]").test(ch))
|
||||
{
|
||||
keyword += ch;
|
||||
ch = rtf.charAt(++_currentParseIndex);
|
||||
@@ -635,7 +635,7 @@ var kRgsymRtf = {
|
||||
|
||||
fParam = true;
|
||||
|
||||
while (/[0-9]/.test(ch))
|
||||
while (new RegExp("[0-9]").test(ch))
|
||||
{
|
||||
param += (ch + '');
|
||||
ch = rtf.charAt(++_currentParseIndex);
|
||||
|
||||
Reference in New Issue
Block a user