Deye Posted August 18, 2019 Share Posted August 18, 2019 Hi I'm Trying to figure out how multi lines should be pended to an expression :? Thanks $sString = "Test" & @LF & _ 'Local $Clear_Button = GUICtrlCreateButton("Clear", 313, 211, 50, 20")' & @LF& @LF & _ '(GUICtrlSetTip(-1, "Clear all Check Boxes")' $s = '(?m:Local \$Clear_Button = GUICtrlCreateButton\("Clear", 313, 211, 50, 20"\))\n+\n+(GUICtrlSetTip\(\-1, "Clear all Check Boxes"\))' ;~ $s = '(Local \$Clear_Button = GUICtrlCreateButton\("Clear", 313, 211, 50, 20"\))' $sString = StringRegExpReplace($sString, $s, "") MsgBox(0, '', $sString) Deye Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 18, 2019 Share Posted August 18, 2019 @Deye Modifiers must be enclosed by separated round parentheses, so, (?m:Local should be (?m)(Local...) Deye 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Deye Posted August 18, 2019 Author Share Posted August 18, 2019 FrancescoDiMuro, Adding (?m)(Local...) didn't work for me, I end up with screwed example code when something doesn't work (I did try that too I believe) Thankfully I want need to get into this, Got the problem solved with my previous post Thanks Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted August 18, 2019 Share Posted August 18, 2019 @Deye Happy to hear that you solved the issue. By the way, both in your test tring and pattern were missing some parentheses which probably were causing the issue Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
mikell Posted August 18, 2019 Share Posted August 18, 2019 I don't know the purpose of this code but please note some details : with your example the multiline option is useless, grouping is not necessary because you don't use backreferences, and \n+\n+ is redundant $sString = "Test" & @LF & _ 'Local $Clear_Button = GUICtrlCreateButton("Clear", 313, 211, 50, 20")' & @LF& @LF & _ '(GUICtrlSetTip(-1, "Clear all Check Boxes")' $s = 'Local \$Clear_Button = GUICtrlCreateButton\("Clear", 313, 211, 50, 20"\)\n+\(GUICtrlSetTip\(\-1, "Clear all Check Boxes"\)' $sString = StringRegExpReplace($sString, $s, "") MsgBox(0, '', $sString) Deye 1 Link to comment Share on other sites More sharing options...
Deye Posted August 18, 2019 Author Share Posted August 18, 2019 (edited) mikell, I needed this for what i was using here marked as solved as the reproducer shows to me now that everything should work but it still Doesn't with my main script, also tried implementing the replace with this version smae thing: @error = 0, @extended = 0 yet to figure why is that Edit : just found it out Thanks Edited August 18, 2019 by Deye 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