Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/27/15, 07:11 PM   #1
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Pattern matching non-English language characters

Hello all,

I am currently looking for a semi-elegant method of matching all letters that are not special language characters like ä, ë, ö, ü, etc. and have been having some trouble.

At first I tried :gsub("%w", string.upper, 1) to replace the first letter of a string with a capital, however this caused any of the above special language characters to become "xx."

I then tried string.sub(teststring, 1, 1) to get just the first character of a string, and it seems these special characters are using 2 (sometimes more?) characters, probably an escape code and a number, to render the actual symbol, so again, I ended up with just "x".

Is there a way to have lua only match the first character in a string if it is a letter and NOT one of these special letters?
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Pattern matching non-English language characters


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off