in reply to search and using first letter of words on a line
That's some pretty ugly HTML (both versions), so I'm going to hope there are some typos in it. You may want to use a module to parse that, or if the tags will always be the same, strip it out with a regex. But once you've got your title, you can get your acronym with something like this:
my $title = "Part II: Nietzsche's Project, An Overall Review"; my $acronym = join '', ($title =~ /(?:^|\s+)(\w)/g); say $acronym; # -> PINPAOR
That'll give you a string containing each word character that follows the start of the string or a group of whitespace characters. You could narrow \w further to just take capital letters or whatever you like.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: search and using first letter of words on a line
by Anonymous Monk on Sep 22, 2011 at 12:10 UTC | |
by aaron_baugher (Curate) on Sep 22, 2011 at 20:21 UTC |