Jump to content
Sign in to follow this  
qwert

Need help with an advanced RegExp call

Recommended Posts

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:

Good solution.png

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 by qwert

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...