0

I am trying to extract following information :

  • Complete account number as in the paragraph (XXXXXXXXXX1234)
  • Amount
  • Info
  • Date

from the following text :

Dear Customer, Thank you for banking with ABC Bank. You have used your Debit Card linked to Account XXXXXXXX1234 for a transaction of INR 404.00 Info.MIN*ABC on 15-08-2012 11:58:41.

I tried using the regular expression answered here, but with no luck. The following is the code i am trying :

let regex = NSRegularExpression.init(pattern: "\d\d?:\d\d", options: nil)

But getting error as "Invalid escape sequence in literal". Thanks for any help.

Community
  • 1
  • 1
Singh
  • 2,151
  • 3
  • 15
  • 30
  • 2
    Give us some code, like what you have tried. [This](http://stackoverflow.com/help/how-to-ask) will help you in drafting a question. And remember, SO is not a code-writing service. – iMan Aug 25 '16 at 11:02
  • 1
    And please never paste code as image. – Desdenova Aug 25 '16 at 11:09
  • Use double backslashes - `"\\d\\d?:\\d\\d"`, but it will get you `11:58` only. Any other, *real* issues? – Wiktor Stribiżew Aug 25 '16 at 11:17

0 Answers0