Contents

Views 965 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

정규표현식으로 문자열 교체하는 예제

예) Kakao 계정에서 닉네임에 이모티콘 있을 시 제거하는 내용

NSString *pattern = @"[^\uAC00-\uD7A3xfe0-9a-zA-Z\\s]";
NSString *kakaoNickname = @"123 &1245; Hooni Test!!^^";

NSError *error = nil;
NSRegularExpression *regex =
    [NSRegularExpression regularExpressionWithPattern:pattern
        options:NSRegularExpressionCaseInsensitive error:&error];

NSString *modifiedString =
    [regex stringByReplacingMatchesInString:kakaoNickname options:0
        range:NSMakeRange(0, [kakaoNickname length]) withTemplate:@""];

NSLog(@"kakaoNickname : %@", modifiedString);



?

  1. [ios] Facebook Cache 갱신하는 함수

    Date2017.02.27 CategoryDevelop Byhooni Views1332
    Read More
  2. [ios] 동영상 플레이어 샘플 (for PIP Player)

    Date2017.03.15 CategoryDevelop Byhooni Views1416
    Read More
  3. Mac OS 에 Jenkins 설치하기 (Homebrew)

    Date2017.03.15 CategoryDevelop Byhooni Views8410
    Read More
  4. [ios] Xcode에서 특정 파일만 ARC 따로 설정하는 방법

    Date2017.03.29 CategoryDevelop Byhooni Views1098
    Read More
  5. [mysql] 쿼리 실행시 ERROR 1366 (HY000) : incorrect string value : for column

    Date2017.03.30 CategoryDatabase Byhooni Views8983
    Read More
  6. [ios] NSString, RegularExpression Find/Replace

    Date2017.04.14 CategoryDevelop Byhooni Views965
    Read More
  7. [ios] Facebook SDK 로그인 설명

    Date2017.04.19 CategoryDevelop Byhooni Views1368
    Read More
  8. [linux] 초간단 Postfix, Covecot, SSL/TLS (SMTP)

    Date2017.12.11 CategorySystem/OS Byhooni Views9528
    Read More
  9. [mysql] ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

    Date2017.12.15 CategoryDatabase Byhooni Views1400
    Read More
  10. [ios] Requesting Location Permissions in iOS

    Date2018.08.18 CategoryDevelop Byhooni Views1746
    Read More
  11. 서버 확장을 위한 두 가지 방법

    Date2018.08.29 CategorySystem/OS Byhooni Views2280
    Read More
  12. 맥에서 포트 확인하고 닫기 (mac)

    Date2022.03.22 CategorySystem/OS Byhooni Views1238
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7