Jump to content

Script problem


 Share

Recommended Posts

  • Moderators

@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 by JLogan3o13

"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

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)

display.jpg.4967f863e2464d6ff076ddba25db7a9f.jpg

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 :D

 

Link to comment
Share on other sites

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." :D

https://www.autoitscript.com/forum/topic/33323-regexp-has-anyone-seen-this-library-before/?page=4&tab=comments#comment-245513

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...