Skip to content

Instantly share code, notes, and snippets.

@preaction
Created January 14, 2016 18:54
Show Gist options
  • Save preaction/dc1efb4ac9c1b4532b58 to your computer and use it in GitHub Desktop.
Save preaction/dc1efb4ac9c1b4532b58 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
no warnings 'experimental::smartmatch';
my $text = <<ENDTEXT;
Řádek pro automatické zpracování:
DOMAINREN|domain.com|2342432|123432424|3242432
ONLINE|stufandssssssssss
ENDTEXT
my @registry_patterns = (
qr/^DOMAINREG\|([^\|]+)\|/m,
qr/^DOMAINREN\|([^\|]+)\|/m,
qr/^DOMAINTRAN\|([^\|]+)\|/m,
qr/^PROCESS\|DOMAINREG\|([^\|]+)\|/m,
qr/^PROCESS\|DOMAINUPD\|([^\|]+)\|/m,
qr/^PROCESS\|DOMAINTRAN\|([^\|]+)\|/m,
qr/^PROCESS\|DOMAINREN\|([^\|]+)\|/m,
qr/^PROCESS\|DOMAINCHG\|([^\|]+)\|/m,
qr/^\| subject of the change: change of the domain (\S+\.\S+)$/m,
qr/^\| subject of the change: change of the owner of the domain (\S+\.\S+)/m,
);
if ($text ~~ @registry_patterns){
print "Matched: $1";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment