View Single Post
Unread 05-27-13, 02:32 PM   #12
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,750
Code:
string.gsub("Echo of a Pandaren Monk", "(%S[\128-191]*)%S+%s", "%1. ")
That pattern doesn't require one or more non-whitespace characters. It requires one or more non-whitespace bytes (eg. \32 is flagged as "whitespace"). In the case of multi-byte characters, the extra bytes per character are matched. In the case of \208\176, neither \208 nor \176 by themselves are "whitespace" so string.gsub sees them as separate non-whitespace entities, since it is not Unicode-aware.

As for your other question, "Echo of a Pandaren Monk" [url="http://ru.wowhead.com/npc=58669"]in Russian[/b] is "Эхо пандарена-монаха". The preposition "of" is generally not used directly in Russian (the declension of the relevant noun changes instead) and articles like "a" and "the" are generally omitted. There are one-character words in Russian that are used often -- в, с, к, у are several that spring to mind -- but I don't know if any of them appear in NPC names.

Edit: A quick scan of Wowhead in Russian finds at least one NPC name with a single-character word -- Эрунак Говорящий с Камнем. There are likely more, but I quit looking after spotting the first one on page 2.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!

Last edited by Phanx : 05-27-13 at 02:40 PM.
Phanx is offline   Reply With Quote