{"id":162,"date":"2007-01-11T15:18:57","date_gmt":"2007-01-11T13:18:57","guid":{"rendered":"https:\/\/alax.info\/blog\/162"},"modified":"2007-01-11T15:21:50","modified_gmt":"2007-01-11T13:21:50","slug":"regular-expression-bug-in-visual-studio-2005","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/162","title":{"rendered":"Regular Expression bug in Visual Studio 2005"},"content":{"rendered":"<p>I already encountered similar issue once before but did not write down the details.<\/p>\n<p>Text:<\/p>\n<p style=\"margin-left: 40px; font-style: italic\">#define TBN_GETBUTTONINFO      (TBN_FIRST-0)<br \/>\n#define TBN_BEGINDRAG           (TBN_FIRST-1)<br \/>\n#define TBN_ENDDRAG             (TBN_FIRST-2)<br \/>\n#define TBN_BEGINADJUST         (TBN_FIRST-3)<br \/>\n#define TBN_ENDADJUST           (TBN_FIRST-4)<br \/>\n#define TBN_RESET               (TBN_FIRST-5)<br \/>\n#define TBN_QUERYINSERT         (TBN_FIRST-6)<br \/>\n#define TBN_QUERYDELETE         (TBN_FIRST-7)<br \/>\n#define TBN_TOOLBARCHANGE       (TBN_FIRST-8)<br \/>\n#define TBN_CUSTHELP            (TBN_FIRST-9)<\/p>\n<p>Find What (using regular expressions):<\/p>\n<p style=\"margin-left: 40px; font-style: italic\"><strong>^\\#define:b+({([A-z\\_])+}):b+.+$<\/strong><\/p>\n<p>Replace With:<\/p>\n<p style=\"margin-left: 40px\"><strong><em>#define MSG_\\1(nIdentifier, Function) CC_MSG_WM_NOTIFY(\\1, NMHDR, nIdentifier, Function)<\/em><\/strong><\/p>\n<p>Visual Studio C++.NET 2003 (correct):<\/p>\n<p style=\"margin-left: 40px; font-style: italic\">#define MSG_TBN_GETBUTTONINFO(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_GETBUTTONINFO, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_BEGINDRAG(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_BEGINDRAG, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_ENDDRAG(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_ENDDRAG, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_BEGINADJUST(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_BEGINADJUST, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_ENDADJUST(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_ENDADJUST, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_RESET(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_RESET, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_QUERYINSERT(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_QUERYINSERT, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_QUERYDELETE(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_QUERYDELETE, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_TBN_TOOLBARCHANGE(nIdentifier, Function) CC_MSG_WM_NOTIFY(TBN_TOOLBARCHANGE, NMHDR, nIdentifier, Function)<\/p>\n<p>Visual Studio C++.NET 2005 (wrong):<\/p>\n<div style=\"margin-left: 40px; font-style: italic\">#define TBN_GETBUTTONINFO      (TBN_FIRST-0)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<br \/>\n#define MSG_(nIdentifier, Function) CC_MSG_WM_NOTIFY(, NMHDR, nIdentifier, Function)<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I already encountered similar issue once before but did not write down the details. Text: #define TBN_GETBUTTONINFO (TBN_FIRST-0) #define TBN_BEGINDRAG (TBN_FIRST-1) #define TBN_ENDDRAG (TBN_FIRST-2) #define TBN_BEGINADJUST (TBN_FIRST-3) #define TBN_ENDADJUST (TBN_FIRST-4) #define TBN_RESET (TBN_FIRST-5) #define TBN_QUERYINSERT (TBN_FIRST-6) #define TBN_QUERYDELETE (TBN_FIRST-7) #define TBN_TOOLBARCHANGE (TBN_FIRST-8) #define TBN_CUSTHELP (TBN_FIRST-9) Find What (using regular expressions): ^\\#define:b+({([A-z\\_])+}):b+.+$ Replace With: #define MSG_\\1(nIdentifier,&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/162\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,21],"tags":[],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-atl","category-seriously"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}