Categories
Swift

Swift in regular expressions

At the beginning of a,Swift did not provide regular expression support,So we can only package,For example write a structure,Like this:

In fact, Swift already has support for regular expressions,We just need to:

Direct will be able to get the captured content。

 

Gets to be a Range ,Tie strings as the corresponding methods,Nature can get captured content。If there is no,Returns an empty,Tie if Optional value binding,Fast and easy!

Original article written by Gerber drop-off:R0uter's Blog » Swift in regular expressions

Reproduced Please keep the source and description link:https://www.logcg.com/archives/1948.html

By R0uter's Blog

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Leave a Reply

Your email address will not be published. Required fields are marked *