Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Perl Regex to take the UC Words.

by vinoth.ree (Monsignor)
on Mar 28, 2013 at 04:52 UTC ( #1025851=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl Regex to take the UC Words.
in thread Perl Regex to take the UC Words.

Try this way,

use strict; use warnings; use Data::Dumper; while(<DATA>) { my @array = $_ =~ m/\b([A-Z]+(?:\d+)?)\b/g; print "@array\n"; } __DATA__ BROUGHTON VETERINARY GROUP123. Leicestershire mixed practice seeks exp +erienced vet to replace assistant relocating to Scotland GIRLING AND BOWDITCH VETERINARY SURGEONS We are looking for an experie +nced vet for our 5 vet mixed practice. STANHOPE PARK VETERINARY HOSPITAL. Due to a pregnancy epidemic we are +looking for 2 new vets, 100% small animal hospital in County Durham.

All is well

Replies are listed 'Best First'.
Re^4: Perl Regex to take the UC Words.
by hdb (Prior) on Mar 28, 2013 at 15:16 UTC

    What about capitalized words later in the line? Shall they be excluded?

    use strict; use warnings; while(<DATA>) { my @array = $_ =~ m/\b([a-zA-Z]+[0-9]*)\b/g; foreach (@array) { last if /[a-z]/; print "$_ "; } print "\n"; } __DATA__ BROUGHTON VETERINARY GROUP123. Leicestershire mixed practice seek EXPE +RIENCED vet to replace assistant relocating to Scotland GIRLING AND BOWDITCH VETERINARY SURGEONS We are looking for an experie +nced vet for our 5 vet mixed practice. STANHOPE PARK VETERINARY HOSPITAL. Due to a pregnancy epidemic we are +looking for 2 new vets, 100% small animal hospital in County Durham.
Re^4: Perl Regex to take the UC Words.
by Anonymous Monk on Mar 28, 2013 at 05:14 UTC
    Thx. Vinoth

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025851]
help
Chatterbox?
[marto]: oddly the last time I was there I saw a zeppelin in flight for the first time
[Corion]: ambrus: I don't know how far the budget estimate has been overrun yet
[Corion]: marto: Heh ;) No, you were likely at Tegel or Schönefeld, the new one ("BER") will be somewhat outside of Berlin ;)
[marto]: Corion Schoenfeld, but my friend has been telling me about this new airport for about 7-8 years now :P
[marto]: I doubt it even exists as a building site :P
[ambrus]: Corion: does building airports "somewhat outside of" a city ever work? cities always grow around the airport quickly, because it's practical to be close to it, and after that, people start to complain that the airplanes land so close to their house and sh
[ambrus]: ould keep down the noise

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2017-02-23 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (346 votes). Check out past polls.