qwert Posted February 5, 2018 Share Posted February 5, 2018 (edited) In conjunction with my recent post on taming script abort messages, I've determined that I CAN alter the text of the message. For example, the following statement in the Dll Call changes both text lines in the displayed abort message. StringRegExpReplace($sText, "(.+)", "This is a test ...") But what I'd like to do is: (1) remove all text bracketed by ( ... ) in the first string ... IOW, by the parenthesis pair (2) replace the entire second string with my own text In other words, have the result appear in this form: Numerous searches and my own meager knowledge of RegExp format didn't produce anything useful. I can eventually figure out the first replacement, but can someone point me to an example that shows how to replace the second string—any second string—with my text? I really don't have a handle on that one. Thanks for any assistance. Edited February 5, 2018 by qwert Link to comment Share on other sites More sharing options...
qwert Posted February 6, 2018 Author Share Posted February 6, 2018 For (1), above, I've found that the following RegExp will locate and replace the parenthesized string: StringRegExpReplace($sText, "\([^)]*\)", "This is a test ...") That leaves (2) as the problem to solve. Link to comment Share on other sites More sharing options...
kylomas Posted February 6, 2018 Share Posted February 6, 2018 qwert, Post #9 in your "clang" thread is not what you want? kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
qwert Posted February 6, 2018 Author Share Posted February 6, 2018 You are correct in pointing that out. I posted my full RegExp statement there because I had started that thread with the Intercept_MessageBoxW function. For anyone following this thread, here's the link to it. Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted February 6, 2018 Share Posted February 6, 2018 The best tool to experiment, and learn regex for me: https://regex101.com/ Should let you do some quick testing and debugging. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now