Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[CONNECT C++] Use TextBlock::FindText() to locate "special" characters in a string

$
0
0

I'm using TextBlock::FindText() to locate text in strings. I can find letters and numbers just fine. I'm attempting to use Regular Expressions to find "Special" characters (like the "Copyright circle"). I've got the Unicode value I want to search for ( \u0169 ), but when I try to search, CONNECT just crashes:

#define REGEX_STRING_SEARCH L"\\x{0169}"

TextBlock::FindTextParametersPtr	findParams;
WString					regEx;
regEx.assign(REGEX_STRING_SEARCH);
findParams->SetUseRegularExpressions(true);
while ((foundRegion = textBlock->FindText(regEx.c_str(), findParams.get(), searchStart.get(), nullptr)).IsValid())
{
...
}

 

I'm sure its an issue of not supplying the proper search string for the Regular Expression. I haven't been able to find a C++  example via Google that I can try. I'll continue to search, but if the answer is known , please post it here.

 

Bruce


Viewing all articles
Browse latest Browse all 4331


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>