<font face="Verdana,Arial,Helvetica,sans-serif" size="2"><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">Thank you for the response, Phillippe.</div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><br></div><div><font face="Verdana, Arial, Helvetica, sans-serif" size="2">I was wondering if the implementation would be exactly like NSRegularExpression.escapedTemplateForString(_:) which simply invokes </font><font face="Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" size="2">_CFRegularExpressionCreateEscapedPattern</font><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;">(CFStringRef pattern)</span><font face="Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" size="2">. </font><span style="font-family: 'Default Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;">Alternatively, is it right to say that "template metacharacters" are a subset of "pattern metacharacters" ?</span></div><div><font face="Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" size="2"><br></font></div><div><font face="Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" size="2">If the above isn't right, could you please describe the logic of the objective-C version of the escapedPatternForString(_:) class method?</font></div><div><br></div><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt"><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt"><div class="socmaildefaultfont" dir="ltr" style="font-family:Arial;font-size:10.5pt"><div dir="ltr">Regards,</div><div dir="ltr"><span style="font-family:georgia,serif;"><span style="font-size: 1.143em;">Pushkar N Kulkarni,</span></span></div>
<div dir="ltr"><span style="font-family:georgia,serif;"><span style="font-size: 1.143em;">IBM Runtimes</span></span></div>
<div dir="ltr"> </div>
<div dir="ltr"><em><span style="font-family:georgia,serif;"><span style="font-size: 0.857em;">"Any sufficiently advanced technology is indistinguishable from magic." - Arthur Clarke</span></span></em></div></div></div></div></font></div><br><br><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2" color="#000000" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font color="#990099"><a href="mailto:-----phausler@apple.com" target="_blank">-----phausler@apple.com</a> wrote: -----</font><div class="iNotesHistory" style="padding-left:5px;"><div style="padding-right:0px;padding-left:5px;border-left:solid black 2px;">To: Pushkar N Kulkarni/India/IBM@IBMIN<br>From: Philippe Hausler <phausler@apple.com><br>Sent by: <a href="mailto:phausler@apple.com" target="_blank">phausler@apple.com</a><br>Date: 02/26/2016 08:47PM<br>Cc: <a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a><br>Subject: Re: [swift-corelibs-dev] NSRegularExpression.escapedPatternForString() unimplemented on Linux<br><br><!--Notes ACF
<meta http-equiv="Content-Type" content="text/html charset=utf8">-->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=""><a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" target="_blank">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a><br class=""></div></blockquote></div><br class=""></div></div></div></phausler@apple.com></div></div></font></font><BR>