Giter Club home page Giter Club logo

commonregex's Introduction

Go Report Card build

commonregex

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]`
  
  date_list := cregex.Date(text)
  // ['Jan 9th 2012']
  time_list := cregex.Time(text)
  // ['5:00PM', '4:00']
  link_list := cregex.Links(text)
  // ['www.linkedin.com', '[email protected]']
  phone_list := cregex.PhonesWithExts(text)  
  // ['(519)-236-2723x341']
  email_list := cregex.Emails(text)
  // ['[email protected]']
}

Features

  • date
  • time
  • phone
  • phones with exts
  • link
  • email
  • ip
  • ipv6
  • 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

commonregex's People

Contributors

mingrammer avatar emaraschio avatar mamal72 avatar schigh avatar

Watchers

zhanglei avatar  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.