Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Parsing Names in a Text File

by davorg (Chancellor)
on Jun 15, 2001 at 18:30 UTC ( #88802=note: print w/replies, xml ) Need Help??


in reply to Parsing Names in a Text File

You're using the escape sequence \w to match characters in the surname. \w matches the characters A-z, a-z, 0-9 and the underscore (_). Your example contains a dash (-) character, so you'll need to add that to the list of allowed characters. Something like this will work:

s/^([A-Z])\w*( [-\w]+)$/$1.$2/g

--
<http://www.dave.org.uk>

Perl Training in the UK <http://www.iterative-software.com>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2022-08-10 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?