Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Perl Regex Help!

by choroba (Abbot)
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"; } }
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Perl Regex Help!
Download Code
Re^2: Perl Regex Help!
by Anonymous Monk on Mar 23, 2013 at 12:36 UTC
    Thank You for your time & help...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (15)
As of 2014-12-18 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls