scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.52k stars 345 forks source link

How to get value contained between pair of square brackets in HTML string. #134

Closed EvgenyKarkan closed 4 years ago

EvgenyKarkan commented 4 years ago

<strong>Lorem Ipsum.<\/strong> Lorem Ipsum. [link-to:shop-page \"instore-pickup\"]Learn More[\/link-to]

Given a sample string (it includes HTML) which I'm getting from 3-rd party service and it's out of my control to improve or normalize it to fit the HTML standard. I need to parse this part somehow [link-to:shop-page \"instore-pickup\"]Learn More[\/link-to] to get the Learn More value.

Is it even possible with the help of SwiftSoup and if so - could someone please show me how to achieve that?