NewShadow Posted November 27, 2018 Share Posted November 27, 2018 Hello, i want my script that I have to delete words of type (8) , (.) , (,) and paste the clear text. The problem is that I do not know how to create and add this function. Does anyone know how to do it? Thank you in advance Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 27, 2018 Share Posted November 27, 2018 @NewShadow Could you please explain better what are you trying to accomplish? Could you please do a real-world example? 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...
Moderators JLogan3o13 Posted November 27, 2018 Moderators Share Posted November 27, 2018 (edited) @NewShadow welcome to the forum. Can you please be a bit more clear on your request? Are you saying you want your script to delete the number 8, any periods and any commas? What do you want to delete them from, a text file, an excel spreadsheet, a GUI, etc.? Please read this post to see what kind of information we need to help you Edited November 27, 2018 by JLogan3o13 FrancescoDiMuro 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
NewShadow Posted November 27, 2018 Author Share Posted November 27, 2018 I have script which copy and paste the text after pressing the hotkey and now I want to add to this functions that will remove bracket with the word e.g: hello (ed) all. I need it. Sry I did not specify the post after. Link to comment Share on other sites More sharing options...
NewShadow Posted November 27, 2018 Author Share Posted November 27, 2018 And paste clean text. Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 27, 2018 Share Posted November 27, 2018 @NewShadow Do you have any script already? If yes, please post it 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...
pixelsearch Posted November 27, 2018 Share Posted November 27, 2018 My 1st RegExp post ever, hope it won't be the last one To our RexExp gurus, could this be a bit of help ? #include <MsgBoxConstants.au3> Local $sInput = "hello (ed) all," & @CRLF & _ "(I) we wish you a (great) terrific moment here !" Local $sOutput = StringStripWS(StringRegExpReplace($sInput, "(?U)(\(.*\))", ""), 4) ; 4 => strip double (or more) spaces between words in function StringStripWS() MsgBox($MB_TOPMOST, "Display", _ "Before :" & @CRLF & $sInput & @CRLF & @CRLF & _ "After :" & @CRLF & $sOutput) Though I'm not totally satisfied with the fact that all double spaces between words become one only but hey, it's my 1st RegExp FrancescoDiMuro 1 Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted November 27, 2018 Share Posted November 27, 2018 @pixelsearch Applause 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...
pixelsearch Posted November 27, 2018 Share Posted November 27, 2018 Thx a lot Francesco Well I finally started (very slowly) to study RegExp, you sure remember the day I started it lol Gladly I discovered an incredible piece of software to test RegExp expressions. There are a lot of them but that one, written by Lazycat (one of the creator of Koda) in 2006-2007 is a must to my eyes :https://www.autoitscript.com/forum/topic/27025-regexp-quick-tester Not forgetting w0uter who opened the road for others, in sept 2005 :https://www.autoitscript.com/forum/topic/16250-stringregexp-design-gui/ Then steve8tch did a great job, based on w0uter's script, in dec 2005 :https://www.autoitscript.com/forum/topic/19058-stringregexp-gui-for-testing/ I want to thank them all, even if they wrote their scripts more than 10 years ago. It's because of these guys (amongst others) that AutoIt is such a great product now. And if you got some time to spend, please don't forget to read the whole long thread (October 2006), when Jon, Valik and a few others implemented RegExp in AutoIt, it's worth the read and even touching because Jon needed help for this, recognizing it humbly. He made me laugh so much when he wrote : "I swear anyone who understands this stuff is clinically insane." https://www.autoitscript.com/forum/topic/33323-regexp-has-anyone-seen-this-library-before/?page=4&tab=comments#comment-245513 careca and FrancescoDiMuro 2 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