Ios Regular Expression replacement, ios Regular Expression

Source: Internet
Author: User

Ios Regular Expression replacement, ios Regular Expression

1. Immutable string (content is immutable)

NSRegularExpression * regularExpression = [NSRegularExpressionregularExpressionWithPattern:

@ "<(/{0,}) div (. {0,})>" options: 0 error: nil];

Content = [regularExpression stringByReplacingMatchesInString: contentoptions: 0 range: NSMakeRange (0, content. length) withTemplate: @ ""];


1. Variable string (content is variable)

[RegularExpression replaceMatchesInString: content options: 0 range: NSMakeRange (0, content. length) withTemplate: @ ""];


IOS development regular expression [] replacement

You are using a path or MD5 encryption.
 
How does the ios Regular Expression Replace the connected <br> with a <br>?

Search

<Br> (\ s * <br>) +
Replace
<Br>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.