 |
|
 |
Hi,
I am using VS 2005.
My main project is a dll and its runtime library is Multi-threaded DLL (/MD) and i used the same option to create the greta.lib but when I am linking it with my DLL. It is giving following error.
error LNK2001: unresolved external symbol "protected: void __thiscall regex::basic_rpattern_base >::_common_init
error LNK2019: unresolved external symbol "protected: void __thiscall regex::basic_rpattern_base >::_common_init(
error LNK2001: unresolved external symbol "public: static bool __cdecl regex::detail::matcher_helper::_do_match_with_stack
error LNK2019: unresolved external symbol "public: static bool __cdecl regex::detail::matcher_helper::_do_match_with_stack
error LNK2001: unresolved external symbol "public: static bool __cdecl regex::detail::matcher_helper::_do_match_impl
error LNK2001: unresolved external symbol "protected: bool __thiscall regex::detail::basic_rpattern_base_impl::_ok_to_recurse(
Any solution.
Regards,
Manish
|
|
|
|
 |
|
 |
Dear Manish,
I did not test GRETA in VS2005.
You can try another easy engine, DEELX, which is developed by myself:
http://www.regexlab.com/deelx/
Sswater Shi
|
|
|
|
 |
|
 |
Make sure the greta projcet setting is compatible with the main project.
I met the link error, after
1, select the correct the multithread DLL/ single thread DLL
2, select the correct unicode mode ( using or not using, the same with the main project)
the link error disappear.
This information Maybe helpful.
|
|
|
|
 |
|
 |
hi
I am too bad with STL. I have to match "hello sudarshan hello" with pattern "hello". The code should return me hello 2 times with their positions.I am sorry that i am troubling you such small thing.But if u could write a small code snippet for this that would be great.Please help me.
Regards
Sudarshan
|
|
|
|
 |
|
 |
Hi
I would like to get the pattern which is matched.No to just match it.
I am new to STL.If u could suggest me some link to learn STL then i would be greatful.Also if some link to some popular regular expressions would be appriciated.Also if u can write a greta documentaion that would be great!!.. Your code is great.
Thanks
Sudarshan
|
|
|
|
 |
|
 |
The second parameter of 'match()' operation is an instance of 'match_result'. You can get the offset and length of matched substring by calling the 'rstart()' and 'rlength()' of 'match_result'.
You can download full 'GRETA' from microsoft.com, home of GRETA. It contains an html, the document of GRETA.
By the way, I, webmaster of regexlab.com, write another simple regex engine, you can take a glance:
http://www.regexlab.com/deelx/[^]
|
|
|
|
 |
|
 |
Hello, everyboday
I tred to split a string. the string should split by two "$", but if one "$" is escaped by a backslash, that meaning this "$" should not treat as spliter.
e.g: string: "Text one\$$$Text two $$======"
I expect result is:
1. Text one\$
2. Text two
3. ======
But the following code does not generate a expected result. It's output like this:
get 0is: Text one\
get 1is: $Text two
get 2is: ======
I want put "\$" to the end of the first substring.
Does anybody know how to implement the codes? Thanks in advance!:
My bad code:
rpattern MyPat( "\\$\\$");
//rpattern MyPat( "\\$\\$",RIGHTMOST); //only get two substring
split_results sp_results;
vector getResults;
const string strTest = "Text one\\$$$Text two $$====== ";
nCnt = MyPat.split(strTest,sp_results );
printf("Get split counter is %d\n",nCnt );
getResults = sp_results.strings();
for( int i = 0;i < nCnt;i++ )
{
cout << "get " << i << "is: " << getResults[i] <<endl;
}
|
|
|
|
 |
|
 |
In your situation, you should use 'Match' operation, not 'Split' operation.
Use this pattern:
([^$\\]|\\.)+
Click this to example.[^]
|
|
|
|
 |
|
 |
Hello, sswater shi
Thank you very much!
Just now, I read some syntax of regular expression in Perl. I found another solution, using a pattern like this: MyNewPat( "(?<!\\\\)\\$\\$",GLOBAL ), can also get the expected result.
use MyNewPat to replace the MyPat in my old code.
Anyway, thanks again!
|
|
|
|
 |
|
 |
Dear sswater shi:
I found we both have bugs in the pattern.
your bug:
the only one $ can also splits the string!
For Example:
My input: Text one\$$$Text two $$======$text three\\$$text four
The result should be:
Text one\$
Text two
======$text three\\
text four
but your result is:
Text one\$
Text two
======
text three\\
text four
My bug:
the result is:
Text one\$
Text two
======$text three\\$$text four
the "======$text three\\$$text four" also should be split like "======$text three\\" and "text four",since the first backslash escaped the second backslash.
I changed my pattern to MyNewPat( "(?<!(\\\\\\\\)*\\\\)\\$\\$",GLOBAL ). it means there are not odd backslash before double $. But it still does not work.
Can you give me some suggestion to fix this bug? Thanks in advance!
Example[^]
-- modified at 21:13 Tuesday 6th November, 2007
|
|
|
|
 |
|
 |
Hello, Friends:
I am reading the book, 'Mastering Regular Expressions' by Jeffrey E.F. Friedl. I found it is easy to solve this problem using MyNewPat("(?
|
|
|
|
 |
|
 |
First of all, thanks for your great article!
I build your sample in VC7.1 with the runtime library set to Multi-threaded DLL (/MD).
There is One linking error:
----------------
Main error LNK2019: unresolved external symbol __imp___CrtDbgReport referenced in function "protected: bool __thiscall regex::basic_rpattern_base |
|
|
|
 |
|
 |
Are you sure that you have set the same runtime library for GRETA project as your main project?
If so, I need to take a test on that situation before I can give you more help.
|
|
|
|
 |
|
 |
Hi,
When I try to compile the sample code I get this nasty looking error. I am using VS8.
c:\greta_sample_src\test\greta\restack.h(355) : error C2923: 'regex::hetero_stack::aligned_sizeof' : 'regex::hetero_stack::stack_node::header' is not a valid template type argument for parameter 'T'
Thanks.
|
|
|
|
 |
|
 |
On GRETA's homepage, they said "GRETA compiles on VC7, VC7.1 and gcc 3.2", so I think they have not tested it on VS8 too.
So, GRETA maybe could not compile on VS8, or you have to resolve the problem by yourself.
I'm sorry I could not be able to help you, because I'm not using VS8.
|
|
|
|
 |
|
 |
Hi,
In order to compile in vs2005, just modify the line as follow :
byte_t m_buf[ aligned_sizeof<<b>typename stack_node::header>::no_rtti + StaticBlockSizeT ];
Regards,
Miaou
|
|
|
|
 |
|
 |
It's don't work for me :/
|
|
|
|
 |
|
 |
byte_t m_buf[ aligned_sizeof<typename stack_node::header>::no_rtti + StaticBlockSizeT ]; // VS.8X Style
|
|
|
|
 |
|
 |
It work with me on VS2005
|
|
|
|
 |
|
 |
How use it in MFC application ?
I get many error!
Hi, all
|
|
|
|
 |
|
 |
I think you got many 'link' error?
If so, pay more attention to the chapter 'Runtime library' upside.
If your problem does not resolved yet, please let me know what kind of error.
|
|
|
|
 |
|
 |
i just download it and run it .How could i do when a dialog signed with Executeable For Debug Session.
|
|
|
|
 |
|
 |
Please contact me in Chinese: sswater@gmail.com
|
|
|
|
 |
|
 |
how does this greta fare in comparison to this CAtlRegExp included in visual studio? I bet it's much more heavy!
thanks
nikos
|
|
|
|
 |
|
 |
I don't know about CAtlRegExp in the VS2005, but in the 2003 it sucks in comparison to GRETA.
|
|
|
|
 |