GithubHelp home page GithubHelp logo

string.re's Introduction

String.re

String.re is an opinionated swift Regex Library which employ NSRegularExpression under the hood with its main goal enhancing the API friendliness and getting rid of the cumbersomeness usability

if you came from other language like javascript / ruby / kotlin, you'll find it easy to master as they share similar API sets and common concepts

  • contains(_ haystack:)

    return whether haystack contains the specified pattern

  • find(_ haystack:)

    return the optional first match result of the specified pattern in haystack

  • scan(_ haystack:)

    return all match result of specified pattern in haystack

  • matchEntire(_ haystack:)

    return whether given pattern matches the entire string of haystack

  • explode(_ haystack:)

    split haystack by given pattern

  • substitute(_ haystack:replacement)

    replace all occurrences against given replacement

  • substitute(_ haystack:replacement)

    replace all occurrences against given closure, which will be provided with the match result and occurrences sequence (zero indexed) the result of the closure will be the replacement for the corresponding occurrence

  • MatchResult

    • .text

      the matching text (SubString) for corresponding match

    • .captures

      zero indexed Array of matching captures for corresponding match, 0 for the entire matching (just like .text)

string.re's People

Watchers

开元米粉实力代购 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.