Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl Regex Help!

by 2teez (Priest)
on Mar 23, 2013 at 12:19 UTC ( #1025028=note: print w/ replies, xml ) Need Help??


in reply to Perl Regex Help!

You can do this, using the OP data:

use warnings; use strict; while(<DATA>){ chomp; if(/(\w{2,3})-/){ print $1,$/; } } __DATA__ $name = "UK-Storee Leaader"; $name = "US-Inventory Specialiist"; $name = "Verifiication Engiineer - Techniical"; $name = "CHN-Speciialist"; $name = "Software Engiineer - Telecom"; $name = "ESP-Busiiness Manager"; $name = "Software Engiineer - Productiiviity"; $name = "FRA-Busiiness Speciialist"; $name = "CAN-Busiiness Speciialist"; $name = "CHE-Inventory Specialiist"; $name = "HK-Iinventory Speciialiist"; $name = "ITA-Speciialist"; $name = "NLD-Busiiness Specialiist";

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: Perl Regex Help!
Download Code
Replies are listed 'Best First'.
Re^2: Perl Regex Help!
by Anonymous Monk on Mar 23, 2013 at 12:37 UTC
    Thanks for your time and help...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2015-07-29 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (267 votes), past polls