<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">To be honest I just didn’t get around to implementing that specific method in my initial implementation. There is a CF function that does that which could be wired up to provide a nearly identical backing to it. <div class=""><br class=""></div><div class="">CFStringRef _CFRegularExpressionCreateEscapedPattern(CFStringRef pattern)</div><div class=""><br class=""></div><div class="">should give you a good starting point to implement the NSRegularExpression side that should follow the same logic as the objective-c version.</div><div class=""><div class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 26, 2016, at 3:28 AM, Pushkar N Kulkarni via swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div style="font-family: Verdana, Arial, Helvetica, sans-serif;" class="">Hello, </div><div style="font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><br class=""></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif;" class="">I have a query regarding NSRegularExpression. I can see that the class method escapedPatternForString(), that escapes all characters in a string which could be treated as metacharacters, is unimplemented as per the latest dev snapshot for Linux.</div><div style="font-family: Verdana, Arial, Helvetica, sans-serif;" class=""><br class=""></div><div class=""><p style="font-family: Menlo; font-size: 14px; line-height: normal;" class=""><b class="">Welcome to Swift version 3.0-dev (LLVM f95d47afa7, Clang f66c5bb67b, Swift b745691a38). Type :help for assistance.</b></p><p style="font-family: Menlo; font-size: 14px; line-height: normal;" class=""><b class=""><font color="#a9a9a9" class=""> 1> </font>import Foundation</b></p><p style="font-family: Menlo; font-size: 14px; line-height: normal;" class=""><b class=""><font color="#a9a9a9" class=""> 2> </font>NSRegularExpression.escapedPatternForString("a+b")</b></p><p style="font-family: Menlo; font-size: 14px; line-height: normal;" class=""><b class="">fatal error: escapedPatternForString is not yet implemented: file Foundation/NSRegularExpression.swift, line 84</b></p><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2" class=""><div class="socmaildefaultfont" dir="ltr" style="font-size: 10.5pt;"><div class="socmaildefaultfont" dir="ltr" style="font-size: 10.5pt;"><div class="socmaildefaultfont" dir="ltr" style="font-size: 10.5pt;"><div dir="ltr" style="font-family: Arial;" class=""><br class=""></div><div dir="ltr" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">However, I see that this method is available on Swift 2.2-dev for OS X. </font></div><div dir="ltr" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class=""><br class=""></font></div><div dir="ltr" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">Could someone please tell me the rationale behind having it unimplemented for Linux? Were there any Linux-specific obstacles implementing it? We </font><span style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: 10.5pt;" class="">would be glad to contribute here.</span></div><div dir="ltr" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class=""><br class=""></font></div><div dir="ltr" class=""><font face="Sans Serif, Verdana, Arial, Helvetica, sans-serif" class="">Thanks in advance.</font></div><div dir="ltr" style="font-family: Arial;" class=""><br class=""><span style="font-family:georgia,serif;" class=""><span style="font-size: 1.143em;" class="">Pushkar N Kulkarni</span></span></div>
<div dir="ltr" style="font-family: Arial;" class=""><span style="font-family:georgia,serif;" class=""><span style="font-size: 1.143em;" class="">IBM Runtimes</span></span></div>
<div dir="ltr" style="font-family: Arial;" class=""> </div>
<div dir="ltr" style="font-family: Arial;" class=""> </div>
<div dir="ltr" style="font-family: Arial;" class=""><em class=""><span style="font-family:georgia,serif;" class=""><span style="font-size: 0.857em;" class="">"Any sufficiently advanced technology is indistinguishable from magic." - Arthur Clarke</span></span></em></div></div></div></div></font></div></font><br class="">
_______________________________________________<br class="">swift-corelibs-dev mailing list<br class=""><a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev<br class=""></div></blockquote></div><br class=""></div></div></div></body></html>