![]() |
#1
|
|||
|
|||
![]()
Help!
So I have a converter from (non-Unicode) Sanskrit 1.2 font to (Devanagari Unicode) Sanskrit 2003 font. http://is.gd/sw9ruq it works perfect in EmEditor. But Word does not support correct RegEx expressions, so I need and ask for help. Code:
1) Works perfect: "([क-ह]|[क़-य़])ρ","ρ\1" "((([क-ह]|[क़-य़])्)+)ρ","ρ\1" "i((([क-ह]|[क़-य़])्)+)","\1i" 2) Works perfect: "i([क-ह]|[क़-य़])","\1ि" "([१३])(([॒॑])+)","\1" 3) Does not work at all: We look for "([॒॑])([ा-ौ]|[ॢॣ]|[ँंः])" and replace it with "\2\1" "(([ा-ौ]|[ॢॣ]|[ँंः]|[॒॑])+)ρ","ρ\1" HTML Code:
(()()) Code:
Word.Find find = app.Selection.Find; string finds = listView1.Items[s].Text; // строка для поиска find.Text = finds; string fonts = txB_NAME_FONT.Text; find.Font.Name = fonts; // поисковый шрифт find.Replacement.ClearFormatting(); string Repl = listView1.Items[s].SubItems[1].Text; //строка для замены Repl = Repl.Replace("\r", string.Empty); find.Replacement.Text = Repl; Object wrap = Word.WdFindWrap.wdFindContinue; Object replace = Word.WdReplace.wdReplaceAll; if ((s == 14) || (s == 199)) { find.Text = ""; if ((finds.IndexOf("[") > 0)||(finds.IndexOf("]") > 0)) { find.Text = ""; find.Text = finds; } else { find.Text = ""; find.Text = "[" + finds + "]"; //оборачиваем в скобки, иначе исключение для регулярок } find.Execute(FindText: Type.Missing, MatchCase: false, MatchWholeWord: false, MatchWildcards: true, // включаем регулярки MatchSoundsLike: missing, MatchAllWordForms: false, Forward: true, Wrap: wrap, Format: true, ReplaceWith: missing, Replace: replace); } ![]() |
Tags |
convert, devanagari, regex |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
wildcards in find & replace to reverse word order | jeffk | Word | 3 | 11-11-2012 01:47 PM |
MS Word Find and Replace not working | allenglishboy | Word | 10 | 07-25-2012 08:05 AM |
![]() |
bthart | Word | 1 | 12-29-2011 12:45 AM |
![]() |
paulkaye | Word | 4 | 12-06-2011 11:05 PM |
find&replace word in uppercase with word in lowercase | andrei | Word | 3 | 10-03-2011 05:11 AM |