GithubHelp home page GithubHelp logo

priestd09 / commonregex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mingrammer/commonregex

0.0 1.0 0.0 37 KB

๐Ÿซ A collection of common regular expressions for Go

License: MIT License

Go 100.00%

commonregex's Introduction



CommonRegex

A collection of often used regular expressions for Go




Inspired by CommonRegex

This is a collection of often used regular expressions. It provides these as simple functions for getting the matched strings corresponding to specific patterns.

Installation

go get github.com/mingrammer/commonregex

Usage

import (
	cregex "github.com/mingrammer/commonregex"
)

func main() {
  text := `John, please get that article on www.linkedin.com to me by 5:00PM on Jan 9th 2012. 4:00 would be ideal, actually. If you have any questions, You can reach me at (519)-236-2723x341 or get in touch with my associate at [email protected]`

  dateList := cregex.Date(text)
  // ['Jan 9th 2012']
  timeList := cregex.Time(text)
  // ['5:00PM', '4:00']
  linkList := cregex.Links(text)
  // ['www.linkedin.com', '[email protected]']
  phoneList := cregex.PhonesWithExts(text)  
  // ['(519)-236-2723x341']
  emailList := cregex.Emails(text)
  // ['[email protected]']
}

Features

  • Date
  • Time
  • Phone
  • Phones with exts
  • Link
  • Email
  • IPv4
  • IPv6
  • IP
  • Ports without well-known (not known ports)
  • Price
  • Hex color
  • Credit card
  • VISA credit card
  • MC credit card
  • ISBN 10/13
  • BTC address
  • Street address
  • Zip code
  • Po box
  • SSN
  • MD5
  • SHA1
  • SHA256
  • GUID
  • MAC address
  • IBAN
  • Git Repository

Thanks to โค๏ธ

License

FOSSA Status

commonregex's People

Contributors

mingrammer avatar fakenine avatar ahmdrz avatar bill-park avatar emaraschio avatar mamal72 avatar getogrand avatar schigh avatar

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.