我们会循序渐进地探索正则表达式:从最基本的空白匹配开始,再到探索 Unicode,最后以否定后行断言收尾。最后,我们还会看看解决首字母缩写的其他思路,包括状态机。
Convert a phrase to its acronym.
Techies love their TLA (Three Letter Acronyms)!
Help generate some jargon by writing a program that converts a long name like Portable Network Graphics to its acronym (PNG).
Punctuation is handled as follows: hyphens are word separators (like whitespace); all other punctuation can be removed from the input.
For example:
| Input | Output |
|---|---|
| As Soon As Possible | ASAP |
| Liquid-crystal display | LCD |
| Thank George It's Friday! | TGIF |
你还没有在任何语言中完成过它。