This commit is contained in:
Kathy Ruffing 2011-08-24 11:41:04 +00:00
parent f95c2a10af
commit 7f36a0993b

View File

@ -257,6 +257,7 @@ namespace DataLoader
// Add the exponent as superscript
return sb.ToString() + "\\up2 " + match.Groups[4].Value + "\\up0 ";
}
#region CommentedOut
//private static string ConvertFortranFormatToScienctificNotation(string str)
//{
// string outstr = "";
@ -408,6 +409,7 @@ namespace DataLoader
// outstr += tstr;
// return outstr;
//}
#endregion
public static string ConvertText(string s1)
{
string s2 = s1;
@ -441,13 +443,18 @@ namespace DataLoader
// superscript next is 0x18
// subscript next is 0x19
// bold next is 0x13
s2 = Regex.Replace(s2, @"\x17([A-Za-z0-9]+)", @"\ul $1\ulnone ");
//s2 = Regex.Replace(s2, @"\x17([^\x17 ]*?)(?:[\x17]|(?= )|\Z)(.*?)", @"\ul $1\ulnone $2");
//s2 = Regex.Replace(s2, @"\x18([^\x18 ]*?)(?:[\x18]|(?= )|\Z)(.*?)", @"\super $1\nosupersub $2");
//s2 = Regex.Replace(s2, @"\x19([^\x19 ]*?)(?:[\x19]|(?= )|\Z)(.*?)", @"\sub $1\nosupersub $2");
s2 = Regex.Replace(s2, @"\x18([^\x18 ]*?)(?:[\x18]|(?= )|\Z)(.*?)", @"\up2 $1\up0 $2");
s2 = Regex.Replace(s2, @"\x19([^\x19 ]*?)(?:[\x19]|(?= )|\Z)(.*?)", @"\dn2 $1\up0 $2");
s2 = Regex.Replace(s2, @"\x13([^\x13 ]*?)(?:[\x13]|(?= )|\Z)(.*?)", @"\b $1\b0 $2");
// if the underline is at beginning of text, don't replace the underline token with a space:
s2 = Regex.Replace(s2, @"^\x17(([A-Za-z0-9]|\\u[0-9]+\?)+)", @"\ul $1\ulnone ");
s2 = Regex.Replace(s2, @"\x17(([A-Za-z0-9]|\\u[0-9]+\?)+)", @" \ul $1\ulnone ");
// \x18([A-Za-z0-9]+)(?:[\x18]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)
s2 = Regex.Replace(s2, @"\x18([A-Za-z0-9]+)(?:[\x18]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)", @"\up2 $1\up0 $2");
s2 = Regex.Replace(s2, @"\x19([A-Za-z0-9]+)(?:[\x19]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)", @"\dn2 $1\up0 $2");
s2 = Regex.Replace(s2, @"\x13([A-Za-z0-9]+)(?:[\x13]|(?= )|\Z|(?=[^A-Za-z0-9]))(.*?)", @"\b $1\b0 $2");
//s2 = Regex.Replace(s2, @"\x18([^\x18 ]*?)(?:[\x18]|(?= )|\Z|/)(.*?)", @"\up2 $1\up0 $2");
//s2 = Regex.Replace(s2, @"\x19([^\x19 ]*?)(?:[\x19]|(?= )|\Z|/)(.*?)", @"\dn2 $1\up0 $2");
//s2 = Regex.Replace(s2, @"\x13([^\x13 ]*?)(?:[\x13]|(?= )|\Z|/)(.*?)", @"\b $1\b0 $2");
s2 = Reg2.Replace(s2, new MatchEvaluator(ReplaceChars));