Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 한글
- window
- Archive
- geofencing
- appstore
- Session
- Firebase
- github
- Notification
- 개발자
- mac
- FLUTTER
- shorebird
- iOS16
- 웹뷰
- Xcode
- darkmode
- Git
- Apple
- JPA
- Swift
- 이미지
- IOS
- Code
- UIButton
- error
- Realm
- MacOS
- SwiftUI
- rxswift
Archives
- Today
- Total
목록영어 (1)
EEYatHo 앱 깎는 이야기
Swift ) 한글, 영어, 숫자, 밑줄 정규식
정규식과 NSRegularExpression.matches 를 이용하면 된다. 한글, 영어, 숫자, 밑줄만 허용하는 정규식 : "^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9_]$" 입력받은 문자열이 정규식에 만족하지는 체크하는 함수 알맞은 문자열 : return true 부적합한 문자열 : return false private func nameValidation(text: String) -> Bool { // String -> Array let arr = Array(text) // 정규식 pattern. 한글, 영어, 숫자, 밑줄(_)만 있어야함 let pattern = "^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9_]$" if let regex = try? NSRegularExpression(pattern: patt..
iOS, Swift
2021. 3. 5. 11:15