Find similar matching filename ?

just started looking at Regular Expression and first glance thoroughly confused. Is there a page for listing expressions ?


Not sure about method but the only way I can see is get an expression from the last known filename then itterate over the contents of a directory using the expression for a match. This may be a long existing need so I'm guessing things would have evolved over the years and by now may have a short & sweet answer ?

Replies

Swift 5 Expressions are covered here: https://docs.swift.org/swift-book/ReferenceManual/Expressions.html


Swift 5 Patterns: https://docs.swift.org/swift-book/ReferenceManual/Patterns.html


>This may be a long existing need so I'm guessing things would have evolved over the years and by now may have a short & sweet answer


If you're talking about Swift, keep in mind that it just reached a reasonably steady v5 (Swift's ABI has just been declared stable w/v5 as an example). Not sure I'd be ready to use 'over the years' to describe what's gone on w/swift up to now, as if it meant 'aged like a fine wine' vs. 'finding it's way' 😉 - of course the basic need is long standing.

Let’s ignore regular expressions for the moment. While you may end up needing them as part of the implementation, I’m still confused about what you’re trying to implement. Can you clarify that? Perhaps with some examples?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

As already stated trying to match / find a filename if it no longer exists / has been renamed, so "this.ine.of.tex(2016).txt" renamed as "this.line.of.text(2017).txt".


Just want to add ... I've downloaded https://github.com/autozimu/StringMetric.swift which looks promising but after following a tut is not working. Says to drag the "sources" folder into the project and make sure "add targets" is checked, but I may be missing something as I can't see the functions it's suppose to have added.