{"id":2048,"url":"https://github.com/ArtSabintsev/Guitar","last_synced_at":"2025-08-02T23:31:16.082Z","repository":{"id":18127003,"uuid":"77019891","full_name":"ArtSabintsev/Guitar","owner":"ArtSabintsev","description":"A Cross-Platform String and Regular Expression Library written in Swift.","archived":true,"fork":false,"pushed_at":"2024-06-20T02:03:44.000Z","size":1931,"stargazers_count":659,"open_issues_count":0,"forks_count":33,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-28T12:17:21.854Z","etag":null,"topics":["carthage","cocoapods","cross-platform","ios","latinization","macos","padding","regex","regular-expression","string-manipulation","swift","swift-package-manager","swift-server","trimming","tvos","watchos"],"latest_commit_sha":null,"homepage":"http://sabintsev.com/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtSabintsev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-21T05:13:47.000Z","updated_at":"2024-11-17T17:10:19.000Z","dependencies_parsed_at":"2022-08-08T06:15:21.717Z","dependency_job_id":null,"html_url":"https://github.com/ArtSabintsev/Guitar","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtSabintsev%2FGuitar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtSabintsev%2FGuitar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtSabintsev%2FGuitar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtSabintsev%2FGuitar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtSabintsev","download_url":"https://codeload.github.com/ArtSabintsev/Guitar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503084,"owners_count":17930507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoapods","cross-platform","ios","latinization","macos","padding","regex","regular-expression","string-manipulation","swift","swift-package-manager","swift-server","trimming","tvos","watchos"],"created_at":"2024-01-05T20:16:02.135Z","updated_at":"2024-12-06T17:30:30.112Z","avatar_url":"https://github.com/ArtSabintsev.png","language":"Swift","funding_links":[],"categories":["Text","The Index"],"sub_categories":["Other free courses","Other Testing","Keychain","String Processing"],"readme":"# Guitar 🎸\n### A Cross-Platform String and Regular Expression Library written in Swift.\n\n[![Build Status](https://travis-ci.org/ArtSabintsev/Guitar.svg?branch=master)](https://travis-ci.org/ArtSabintsev/Guitar) [![Platform](https://img.shields.io/badge/Platforms-iOS%20%7c%20macOS%20%7c%20tvOS%20%7c%20watchOS%20%7c%20Linux%20-lightgray.svg?style=flat)](http://sabintsev/com/Guitar)\n\n![Swift Support](https://img.shields.io/badge/Swift-5.3-orange.svg)  [![CocoaPods](https://img.shields.io/cocoapods/v/Guitar.svg)](https://cocoapods.org/pods/Guitar) [![SwiftPM Compatible](https://img.shields.io/badge/SwiftPM-Compatible-brightgreen.svg)](https://swift.org/package-manager/)\n\n## About\nThis library seeks to add common string manipulation functions, including common regular expression capabilities, that are needed in both mobile and server-side development, but are missing in Swift's Standard Library.\n\nThe full documentation can be found at http://www.sabintsev.com/Guitar/.\n\nGuitar is also part of [Swift's Source Compatibility Suite](https://swift.org/source-compatibility/#current-list-of-projects).\n\n## Features\n- [x] Boolean Functions (`isAlpha`, `isNumeric`, `isUppercase`, etc.)\n- [x] Case Functions (`camelCased`, `pascalCased`, `kebabCased`, etc.)\n- [x] Latinization Functions (`.latinized()`, `.withoutAccents()`)\n- [x] Padding Functions (`padLeft`, `padRight`, `pad`)\n- [x] Regular Expressions (with Common Patterns Built-in)\n\n### Sherlocked\n\nA small set of functions offered by Guitar were removed in v0.3.0 of the library as Apple added many of these features to the Swift 4 language (aka, [Sherlocking](http://www.urbandictionary.com/define.php?term=sherlocked)). The functions that were removed were: `first, last, length, prefixed, suffixed, trimLeft, trimRight, truncated`. The `reversed` function was renamed to `reversedString` as it acts slightly differently than Swift's built-in `reversed` function.\n\n## Installation Instructions\n\n| Swift Version |  Branch Name  | Will Continue to Receive Updates?\n| ------------- | ------------- |  -------------\n| 5.1+  | master | **Yes**\n| 5.0  | swift5.0 | No\n| 4.2  | swift4.2 | No\n| 4.1  | swift4.1 | No\n| 3.2  | swift3.2 | No\n| 3.1  | swift3.1 | No\n\n### CocoaPods\n```ruby\npod 'Guitar' # Swift 5.1+\npod 'Guitar', :git =\u003e 'https://github.com/ArtSabintsev/Guitar.git', :branch =\u003e 'swift5.0' # Swift 5.0\npod 'Guitar', :git =\u003e 'https://github.com/ArtSabintsev/Guitar.git', :branch =\u003e 'swift4.2' # Swift 4.2\npod 'Guitar', :git =\u003e 'https://github.com/ArtSabintsev/Guitar.git', :branch =\u003e 'swift4.1' # Swift 4.1\npod 'Guitar', :git =\u003e 'https://github.com/ArtSabintsev/Guitar.git', :branch =\u003e 'swift3.2' # Swift 3.2\npod 'Guitar', :git =\u003e 'https://github.com/ArtSabintsev/Guitar.git', :branch =\u003e 'swift3.1' # Swift 3.1\n```\n\n### Swift Package Manager\n```swift\n.Package(url: \"https://github.com/ArtSabintsev/Guitar.git\", majorVersion: 1)\n```\n\n## Usage Examples\n\n### Regular Expression\n- `Guitar` makes it easier to use Regular Expressions to test and evaluate `String` objects.\n- `Guitar.Chord` enumerates common regular expressions and they are located in _GuitarChord.swift_.\n- _GuitarCommon.swift_ contains a list of convenience methods for common regular expression evaluations and tests, such as checking the string to determine if it's a valid email address.\n\n#### Initialization\n\n```swift\nGuitar(pattern: String) // A custom regular expression with which to initialize Guitar.\n\nGuitar(chord: Guitar.Chord) // A common regular expression with which to initialize Guitar.\n```\n\n#### Methods\n\n`evaluateForRanges(::)` returns an array of ranges, `[Range\u003cString.Index\u003e]`, that match a specific regular expression.\n```swift\nGuitar(chord: .firstCharacter).evaluateForRanges(from: \"Hello world\") // [Range(Swift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 0), _countUTF16: 1)..\u003cSwift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 1), _countUTF16: 1)), Range(Swift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 6), _countUTF16: 1)..\u003cSwift.String.CharacterView.Index(_base: Swift.String.UnicodeScalarView.Index(_position: 7), _countUTF16: 1))]\n```\n\n`evaluateForStrings(::)` returns an array of strings, `[String]`, that match a specific regular expression.\n```swift\nGuitar(chord: .firstCharacter).evaluateForStrings(from: \"Hello world\") // [\"H\", \"w\"]\n```\n\n`test(::)` evaluates a string with a specific regular expression. `true` is returned if matches are found in the string. Otherwise, `false` is returned.\n```swift\nGuitar(chord: .email).test(string: \"hello@world.com\") // `true`\n```\n\n### String Extension\n\nThis library also adds dozens of methods via `String` extensions that are missing in the Swift Standard Library or not easily accessible on the `String` class. Check `GuitarBoolean.swift` and `GuitarPadding.swift` to see these examples.\n\nMore specific examples can be found in the\n[tests](https://github.com/ArtSabintsev/Guitar/tree/master/Tests/) folder.\n\n## Inspiration\n- [StringUtils](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html)\n- [Voca](https://vocajs.com/)\n\n## Created and maintained by\n[Arthur Ariel Sabintsev](http://www.sabintsev.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArtSabintsev%2FGuitar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArtSabintsev%2FGuitar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArtSabintsev%2FGuitar/lists"}