ios - RegEx in Swift? -


I am learning Swift, and I have (second) the question whether Swift has regular espressance, and if so How do I use them?

In my research, I got some conflicting information. There is some mention of RegEx in it, but it looks very different than any other language I have seen. If this is the solution, how do I use it?

The website, on the other hand, suggests that the regx is not present in Swift. Is it true?

If this helps, then I am trying to use regex to get the average price of bitcoine from the JSON-style API, which contains the value, but there are not many things.

Unfortunately, there is a lack of reggae in Swift, literally. But the external links which you are exposed to two ways of using regex.

  1. Create a classroom cover around NSRGeneration Expression and use this class.
  2. Foundation method calling RangeOfString: option: with RegularExpression Search as the option. In Swift, it is simple to clean the other way.

Method method definition in swift

  func rangeOfString (_ aString: string !, option mask: NSStringCompareOptions) - & gt; You can use it as a regex match:  
  myStringToBeMatched = "ThisIsMyString" myRegex = "IN $" if mailed = MyStringToBeMetched     


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -