Mendokse
asked on
regular expression : compare code with and without unicode _T macro
Hi Experts,
I have to maintain two versions of a soft. One has been migrated to support unicode strings (using _T macro), the other one not.
When I compare my 2 versions, all strings are shown as different because of _T macro...
I didn't find how to build a regular expression in beyond compare to tell that I don't want it to show this as a difference.
Any help would be greatly appreciated !
Thanks in advance
I have to maintain two versions of a soft. One has been migrated to support unicode strings (using _T macro), the other one not.
When I compare my 2 versions, all strings are shown as different because of _T macro...
I didn't find how to build a regular expression in beyond compare to tell that I don't want it to show this as a difference.
Any help would be greatly appreciated !
Thanks in advance
ASKER
Hello jb1dev
Thanks for your help !
"I guess you are using some diff tool which allows you to define a regex to first massage the data before diffing?". You're totally right. I'm using beyond compare which allows to create "rules" to exclude parts of the files to diff.
Using your proposal, I found that the folowwing expression is almost working
_T\([^)]*\)
But, this expression excludes all the text between parenthesis, and I only want to exclude _T(), not what's inside.
For example,
if I compare _T("this is a test") and "this is a test", I want no diff
but
if I compare _T("This is my test") and "this is a test", I want this to be shown as a diff....
I hope I'm more clear than in my first message...
Thanks
Thanks for your help !
"I guess you are using some diff tool which allows you to define a regex to first massage the data before diffing?". You're totally right. I'm using beyond compare which allows to create "rules" to exclude parts of the files to diff.
Using your proposal, I found that the folowwing expression is almost working
_T\([^)]*\)
But, this expression excludes all the text between parenthesis, and I only want to exclude _T(), not what's inside.
For example,
if I compare _T("this is a test") and "this is a test", I want no diff
but
if I compare _T("This is my test") and "this is a test", I want this to be shown as a diff....
I hope I'm more clear than in my first message...
Thanks
Does your regex support grouping / replace?
If so try:
s/_T\(([^)]*)\)/$1/g
If so try:
s/_T\(([^)]*)\)/$1/g
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help, but it seems it can't work the way I want... Beyond Compare is really weird.
BTW, thank you for the effort, I give you points for this.
BTW, thank you for the effort, I give you points for this.
ASKER
Solution not working but there is no solution with the used tool.
's/_T([^)]*)//g