We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ubuntu 15.10
md5: 0292be96ae89e0648973a601f0bf1ce6
Issue Description:
The following code example only matches once on Linux, but works as expected on OS X
import Foundation let text = " * Item 1\n * Item 2\n * Item 3\n * Item 4\n * Item 5\n * Item 6\n" let pattern = "(\\n)?(^[ \\t]*)([*-])[ \\t]+((?s:.+?)(\\n{1,2}))(?=\\n*(\\z|\\2([*-])[ \\t]+))" if let regex = try? NSRegularExpression(pattern:pattern,options:[NSRegularExpressionOptions.AnchorsMatchLines]){ //Template replacement var mutableString = NSMutableString(string:text) regex.replaceMatchesInString(mutableString, options: NSMatchingOptions(), range: NSMakeRange(0,text.characters.count), withTemplate: "Matched: $4") //Print result print(mutableString) }
Expected output is
Matched: Item 1 Matched: Item 2 Matched: Item 3 Matched: Item 4 Matched: Item 5 Matched: Item 6
But on Linux the template is only applied once (same is true when enumerating with blocks only one match is returned)
Matched: Item 1 * Item 2 * Item 3 * Item 4 * Item 5 * Item 6
Example on IBM Swift Sandbox
The text was updated successfully, but these errors were encountered:
I have been doing some other work on NSRegularExpression and can take a look at this as well.
Sorry, something went wrong.
Comment by Swift Studies (JIRA)
Great!
PR created: #301
PR merged
pushkarnk
No branches or pull requests
Environment
Ubuntu 15.10
Additional Detail from JIRA
md5: 0292be96ae89e0648973a601f0bf1ce6
Issue Description:
The following code example only matches once on Linux, but works as expected on OS X
Expected output is
But on Linux the template is only applied once (same is true when enumerating with blocks only one match is returned)
Example on IBM Swift Sandbox
The text was updated successfully, but these errors were encountered: