A
Aristotle
Could you please help me out with regular expressions. I'm trying to
write a perl script that proccesses some text, and i'm stuck at the
following:
need to remove from the text below all words starting and ending with
lower case letters. Words maybe followed by dot "." or not (most do),
and may contain a "-" character:
eg:
---> Apis calc. Carb-v. cham. dendr-pol. halia-lac. hep. lac-leo. lyc.
Med. nat-m. nit-ac. nux-v. OPIUM plat. polys. PULS. rauw. sal-fr.
Sanguis-s sil. sulph. Tarent. tung-met. VERAT. viol-o vio-zinc.
zinc-c.
should yield:
---> Apis Carb-v. Med. OPIUM PULS. Sanguis-s Tarent. VERAT.
ie words starting with a capital letter must remain untouched.
I've tried various combinations of reg exp before posting here, but
could not find the right one.
I'd really appreciate your help.
write a perl script that proccesses some text, and i'm stuck at the
following:
need to remove from the text below all words starting and ending with
lower case letters. Words maybe followed by dot "." or not (most do),
and may contain a "-" character:
eg:
---> Apis calc. Carb-v. cham. dendr-pol. halia-lac. hep. lac-leo. lyc.
Med. nat-m. nit-ac. nux-v. OPIUM plat. polys. PULS. rauw. sal-fr.
Sanguis-s sil. sulph. Tarent. tung-met. VERAT. viol-o vio-zinc.
zinc-c.
should yield:
---> Apis Carb-v. Med. OPIUM PULS. Sanguis-s Tarent. VERAT.
ie words starting with a capital letter must remain untouched.
I've tried various combinations of reg exp before posting here, but
could not find the right one.
I'd really appreciate your help.