I hereby claim:
- I am Bas-Man on github.
- I am basman (https://keybase.io/basman) on keybase.
- I have a public key ASCnFgOVrIuO3aoI322zwdy49mb9r5GlyegTo5Lmd1X7Kwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
fn main() { | |
let regex = regex::Regex::new(r"(?P<a_only>a$)|(?:a:)(?P<a_colon>[^/].+)|(?P<a_slash>a/\d{1,2})").unwrap(); | |
[ | |
"a", | |
"a:example.com", | |
"a:mailers.example.com", | |
"a/24", | |
"a:offsite.example.com/24]", | |
] |
use regex::{Regex, RegexSet}; | |
fn main() { | |
let string1 = "a:test"; | |
let string2 = "a/24"; | |
let string3 = "a"; | |
let string4 = "a:test/24"; | |
// Create a RegexSet | |
let regex_set = RegexSet::new(&[r"(a$)", r"a:(.*)", r"a(/\d{1,2})"]).unwrap(); |
use trust_dns_resolver::error::ResolveResult; | |
use trust_dns_resolver::Resolver; | |
use trust_dns_resolver::{config::*, lookup::TxtLookup}; | |
fn main() { | |
// Construct a new Resolver with default configuration options | |
let resolver = Resolver::new(ResolverConfig::default(), ResolverOpts::default()).unwrap(); | |
// Lookup the IP addresses associated with a name. | |
// The final dot forces this to be an FQDN, otherwise the search rules as specified |
use trust_dns_resolver::error::ResolveResult; | |
use trust_dns_resolver::Resolver; | |
use trust_dns_resolver::{config::*, lookup::SoaLookup}; | |
fn main() { | |
// Construct a new Resolver with default configuration options | |
let resolver = Resolver::new(ResolverConfig::default(), ResolverOpts::default()).unwrap(); | |
let soa_response = resolver.soa_lookup("gmail.com."); |
use trust_dns_resolver::config::*; | |
use trust_dns_resolver::Resolver; | |
// Note you should add the crate to your Cargo.toml file | |
// trust-dns-resolver = "0.20.1" | |
fn main() { | |
// Construct a new Resolver with default configuration options | |
let resolver = Resolver::new(ResolverConfig::default(), ResolverOpts::default()).unwrap(); |
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
([一-龯]) | |
Regex for matching Hirgana or Katakana | |
([ぁ-んァ-ン]) | |
Regex for matching Non-Hirgana or Non-Katakana | |
([^ぁ-んァ-ン]) | |
Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
import email.parser | |
from email import policy | |
def openFromFile(fp) -> email.message.EmailMessage: | |
""" | |
Read in the open file pointer | |
:param fp: file pointer to open file. | |
:type fp: file pointer | |
:returns: msg which is an email.message.EmailMessage |