<commit_before>Go Regexp Common Patterns
========

A collection of common regex patters for Go

### Usage

```
import (
	"fmt"
	"github.com/jsimnz/regexcom"
)

func main() {
	url := "http://github.com"
	if regexcom.Url.Match(url) {
		fmt.Println("Corret URL!")
	} else {
		fmt.Println("Sorry, invalid URL!")
	}
}

// The overall pattern for the regex common package
// is to call Match(s string) on any given pattern
// Ex
//    regexcom.<Pattern>.Match(s string) bool
//
// Look below for available patterns

```

### Patterns

```
Numeric 				- 	Numeric values.
Alpha 					-	Characters and letters (upper and lower case).
AlphaNumeric 			- 	Numbers and letters (upper and lower case).
AlphaCapsOnly			-	Upper case characters only.
AlphaNumericCapsOnly	-	Numeric values and upper case only characters.
Url 					-	Match a url patter. Can match http, https, ftp, ftps, no-scheme, no www. (See test).
Email 					-	Match an email pattern, user@domain.tld.
HashtagHex				-	Match hexidecimal prefixed with '#' (IE #afe), commonly used for colors.
ZeroXHex				-	Match C syntax 0x hexidecimal typing (IE 0xAF, only upper characters or only lower).
IPv4					-	Match an IPv4 address, (IE. 192.168.1.1)
IPv6					-	Match an IPv6 address, 

More to come...
```

### Create your own pattern

Each pattern is defined on a simple Pattern struct, and uses the standard syntax regexcom.<Pattern>.Match(string) bool
```
YouPattern := regexcom.NewPattern("regex-pattern")
// Then you can use it as normal
YouPattern.Match(string)
```

### Contribute
- Fork It
- Add your own Pattern in top 'var' block
- Create pull request
- Be happy! :smile:

### Author
- [jsimnz](https://github.com/jsimnz)

### LICENCE
The MIT License (MIT)

Copyright (c) 2014 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal<commit_msg>Updated README, again<commit_after>Go Regexp Common Patterns
========

A collection of common regex patters for Go

## Usage

```
import (
	"fmt"
	"github.com/jsimnz/regexcom"
)

func main() {
	url := "http://github.com"
	if regexcom.Url.Match(url) {
		fmt.Println("Corret URL!")
	} else {
		fmt.Println("Sorry, invalid URL!")
	}
}

// The overall pattern for the regex common package
// is to call Match(s string) on any given pattern
// Ex
//    regexcom.<Pattern>.Match(s string) bool
//
// Look below for available patterns

```

## Patterns

```
Numeric 				- 	Numeric values.
Alpha 					-	Characters and letters (upper and lower case).
AlphaNumeric 			- 	Numbers and letters (upper and lower case).
AlphaCapsOnly			-	Upper case characters only.
AlphaNumericCapsOnly	-	Numeric values and upper case only characters.
Url 					-	Match a url patter. Can match http, https, ftp, ftps, no-scheme, no www. (See test).
Email 					-	Match an email pattern, user@domain.tld.
HashtagHex				-	Match hexidecimal prefixed with '#' (IE #afe), commonly used for colors.
ZeroXHex				-	Match C syntax 0x hexidecimal typing (IE 0xAF, only upper characters or only lower).
IPv4					-	Match an IPv4 address, (IE. 192.168.1.1)
IPv6					-	Match an IPv6 address, 

More to come...
```

## Create your own pattern

Each pattern is defined on a simple Pattern struct, and uses the standard syntax regexcom.<Pattern>.Match(string) bool
```
YouPattern := regexcom.NewPattern("regex-pattern")
// Then you can use it as normal
YouPattern.Match(string)
```

## Install
```
go get github.com/jsimnz/regexcom
```

## Contribute
- Fork It
- Add your own Pattern in top 'var' block
- Create pull request
- Be happy! :smile:

## Author
- [jsimnz](https://github.com/jsimnz)

## LICENCE
The MIT License (MIT)

Copyright (c) 2014 <NAME>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
{'fraction_non_alphanumeric': 0.11490683229813664, 'fraction_numerical': 0.009316770186335404, 'mean_word_length': 3.5363849765258215, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6972961', 'n_tokens_mistral': 1358, 'n_tokens_neox': 1245, 'n_words': 469}