Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Perl Regex Help!

by choroba (Chancellor)
on Mar 23, 2013 at 12:04 UTC ( #1025027=note: print w/replies, xml ) Need Help??

in reply to Perl Regex Help!

If the country code is always all uppercase, you can use the following simple regex:
#!/usr/bin/perl use warnings; use strict; for ('UK-Storee Leaader', 'US-Inventory Specialiist', 'Verifiication Engiineer - Techniical', 'CHN-Speciialist', 'Software Engiineer - Telecom', 'ESP-Busiiness Manager', 'Software Engiineer - Productiiviity', 'FRA-Busiiness Speciialist', 'CAN-Busiiness Speciialist', 'CHE-Inventory Specialiist', 'HK-Iinventory Speciialiist', 'ITA-Speciialist', 'NLD-Busiiness Specialiist', ) { if (/^([[:upper:]]+)-/) { print "Country code: $1 in $_.\n"; } else { print "No country code in $_.\n"; } }
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Perl Regex Help!
by Anonymous Monk on Mar 23, 2013 at 12:36 UTC
    Thank You for your time & help...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025027]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2016-10-25 07:53 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (315 votes). Check out past polls.