View Single Post
05-27-13, 02:32 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

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