Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ogulcan/SwiftRegEx

A playground to learn regular expressions with Swift
https://github.com/ogulcan/SwiftRegEx

regex regular-expression swift swift-3

Last synced: 3 months ago
JSON representation

A playground to learn regular expressions with Swift

Awesome Lists containing this project

README

        

# SwiftRegEx

A playground to learn regular expressions with Swift. We developers obviously know that it's not an easy work to use Regular Expressions. This is my challenge, I would like to add a new and efficient tool to my skills.

### Overview

Before I started, checked some documents also with a few tutorials and decided to go away with [this repository](https://github.com/zeeshanu/learn-regex). So, lots of examples and descriptions are excerpted from repo.

This repository contains a playground project that builds with Xcode 9 and Swift 4.

### Content

* How to use RegEx with Swift [#](https://github.com/ogulcan/SwiftRegEx/blob/master/SwiftRegEx.playground/Contents.swift#L23)
* A RegEx wrapper class to handle crowd[#](https://github.com/ogulcan/SwiftRegEx/blob/master/SwiftRegEx.playground/Contents.swift#L44)
* Meta Characters with examples [#](https://github.com/ogulcan/SwiftRegEx/blob/master/SwiftRegEx.playground/Contents.swift#L127)
* Quantifiers with examples [#](https://github.com/ogulcan/SwiftRegEx/blob/master/SwiftRegEx.playground/Contents.swift#L232)
* Shorthand sets [#](https://github.com/ogulcan/SwiftRegEx/blob/master/SwiftRegEx.playground/Contents.swift#L330)
* Flags [#](https://github.com/ogulcan/SwiftRegEx/blob/master/SwiftRegEx.playground/Contents.swift#L346)
* And some common examples like email, html tag etc. [#](https://github.com/ogulcan/SwiftRegEx/blob/master/SwiftRegEx.playground/Contents.swift#L379)

### Useful Links

* [Easy RegEx](https://github.com/zeeshanu/learn-regex)
* [RegEx Cheat Sheet](https://www.cheatography.com/davechild/cheat-sheets/regular-expressions/pdf_bw/)
* [Enter the string that you want to use a regular expression on](https://txt2re.com/)
* [My favourite online RegEx tester](https://regex101.com/)

#### To-do

- [ ] Better wrapper class, maybe an extension for String
- [ ] More common examples