Deye Posted November 23, 2018 Share Posted November 23, 2018 (edited) Hi, how should i use StringRegExpReplace to replace all lines to the needed format like ", #, #, #, #" if I have lines with "Local $sString = GUICtrlCreateInput(1 , 29,46, 46 , 25)" so it will turn into (like how tidy does it) "Local $sString = GUICtrlCreateInput(1, 29, 46, 46, 25)" so a match string (to perform on it later) can also be a case sensitive search as : ", 29, 46, 46, 25" Thanks Deye Edited November 23, 2018 by Deye Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 23, 2018 Share Posted November 23, 2018 @Deye So you need to extract digits separated by a comma? 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...
mikell Posted November 23, 2018 Share Posted November 23, 2018 Regex is nice, but sometimes simpler is better $s = "1 , 29,46, 46 , 25" Msgbox(0,"", StringReplace(StringStripWS($s, 8), ",", ", ") ) FrancescoDiMuro and Deye 1 1 Link to comment Share on other sites More sharing options...
Deye Posted November 23, 2018 Author Share Posted November 23, 2018 Guys, Thanks for helping me think it thorough, Added a solution for this to _GUICtrlTuner.au3 a bump version: 1.0.3.0 Deye Link to comment Share on other sites More sharing options...
mikell Posted November 24, 2018 Share Posted November 24, 2018 Sorry, I didn't read the OP carefully enough. Here is the good answer for the whole string : $s = "Local $sString = GUICtrlCreateInput(1 , 29,46, 46 , 25)" Msgbox(0,"", StringRegExpReplace($s, '\h*,\h*', ", ") ) Deye 1 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