1

is there a way in Swift to split a String via RegEx?

Example:

Given String: "Hello?00it's me?01and I love?02you my Darling"
Wanted Array: ["Hello", "it's me", "and I love", "you my Darling"]

So I want to split the string by "?01", "?02", and so on

The RegEx would be "\?[0-9]{2}"

Andreas Utzinger
  • 392
  • 2
  • 12
  • 2
    See if [the following Q&A](http://stackoverflow.com/questions/28503449/swift-replace-substring-regex) can help you out. – dfrib May 19 '16 at 22:01
  • Of course, first replacing the occurings and then splitting. Why didn't I think of that first? Thx :D – Andreas Utzinger May 19 '16 at 22:32

0 Answers0