Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/06/2023 in all areas

  1. pixelsearch

    RegExpQuickTester 2.5r

    Hi everybody Here is the script I use to test RegEx patterns offline, it's handy. Credits go to Lazycat, who scripted it initially many years ago and thanked "w0uter for ideas and parts of code". I added some modifications (listed in next post) and would like to thank @jchd @mLipok @mikell @Nine @mistersquirrle @taurus905 and @ioa747 for their contribution. Below are the match text & patterns corresponding to the pic above. For a start, you can copy and paste them in their respective edit control. After you choose the corresponding RegExp mode from the ComboBox at the bottom of the screen (mode 3 = return array of global matches) then you'll have the same results as displayed in the pic above. Match Text : blabla...blabla... blabla..."https://media.pic1.jpg"blabla..."https://media.pic2.png"... blabla..."https://media.pic3.jpg"blabla..."https://media.pic4.png"... blabla...blabla... Pattern : (?i)"([^"]+?\.(?:jpg|png))" When you end the script, 2 files will be created in the same directory of the script. Assuming your script is named "RegExpQuickTester 2.5p.au3", the 2 files created will be : * "RegExpQuickTester 2.5p.txt" which contains the saved Match Text that will be reused when you run the script. * "RegExpQuickTester 2.5p.ini" which contains the saved options that will be reused when you run the script. A right click while hovering over the Edit control of the Search Pattern will display a helpful context menu, with possibility to paste something from the menu inside the Search Pattern. Personally I nearly don't paste anything from the context menu but as this feature was created by the original scripter... Instead I like to consult this context menu as a RegExp syntax reminder ! Anyway, just experiment it and choose what's best for you. 99% of the time, the Search Pattern Tab will be on top. If you notice another colored Tab (except the Personal Tab which will never be highlited), then it means that there is something written in this other tab : the color is here only to remind you that there IS something in this other tab, in case you had forgotten. Even a space or a blank line would color the Tab. YJ This particular design (due to original scripter) won't allow you to type "" in the Replace Pattern Tab (mikell frowned, concerning this missing feature). Gladly I found that typing a non existing group, for example $99 will have the same effect as "" so it's a workaround that seems to do the job. The "Code" button allows you to generate the corresponding AutoIt code, which will be copied to the Clipboard Don't hesitate to ask if you have questions. Our RegExp gurus (that's not me) just love RegExp questions Edit: I forgot. You can drag a text file (or htm etc...) inside the Match Text edit control (it's a droppable zone) . There shouldn't be a 32Kb file size limit anymore as I added code to override this limit. There are probably a couple of other functionalities I'm not thinking of now, you'll easily find what you need if you look at the code. And if you want to modify something in the code, don't hesitate. Just share here your modifications in case other users find them useful too, thanks. Updates are detailed in next post Download last version 11 nov 2024 : RegExpQuickTester 2.5r.au3
    1 point
  2. @youtuber this is why I told you to run the regex multiple times until replaces all unwanted leading and trailing characters. Saving as binary is at least odd since you will basically double the size of data in ini file.
    1 point
  3. I use it that way in my script Regexp Quicktester where saving the pattern in an ini file has to be done "as-is", all characters in the pattern being crucial (spaces, quotes etc...)
    1 point
  4. Just in case... if you're not bothered your ini file isn't easily readable outside the script, then you can iniwrite/iniread it like this, without any space or double quotes issues. Even multi lines will be accepted : IniWrite($sIniFile, "Main", "Pattern", StringToBinary(GUICtrlRead($ebRegExp), 4)) ; 4 = $SB_UTF8 (string data is UTF8) ... GUICtrlSetData($ebRegExp, BinaryToString(IniRead($sIniFile, "Main", "Pattern", ""), 4)) ; 4 = $SB_UTF8 (binary data is UTF8)
    1 point
  5. @CYCho I haven't tried CFT yet, but you should be able to use it instead of standard Chrome if you desire. There will be an update to the UDF this month to account for the new download site for Chromedriver.
    1 point
  6. This will replace leading and trailing double quotes and spaces. $sString = '","event":"(.*?)"timing":"' $sString = StringRegExpReplace($sString, '^[" ]|[" ]$', '') & @CRLF ConsoleWrite($sString) But maybe you should test the pattern multiple times since you might have a string like that: So you replace the trailing double quotes but you end up with a trailing space. You can prevent that by testing the pattern multiple times. $sString = '","event":"(.*?)"timing": "' Do $sString = StringRegExpReplace($sString, '^[" ]|[" ]$', '') Until @extended = 0 ConsoleWrite($sString & @CRLF)
    1 point
  7. There is no issue, InetGet() works in 2 different ways. If you specify INET_DOWNLOADBACKGROUND then function return a handle that can be used with InetGetInfo() to get more info about the download process. If you use INET_DOWNLOADWAIT (default mode) the function wait until the download is done and return the number of bytes downloaded. In your case default mode was implicit but you expected to use InetGetInfo() and this doesn't work. I used INET_FORCERELOAD just to be sure I don't get anything from cache.
    1 point
  8. You need to formulate your questions way better. So you want to check if a string begin and end with double quotes or space. If the pattern match do you still want to add double quotes and spaces? What if the string start with space and end with double quotes?
    1 point
  9. This question has already been answered by @Nine, see : There are two versions of the infotool, Au3Info.exe and Au3Info_x64.exe (64-Bit). These files are located in the [installation path]\AutoIt3\ folder. Take these two .exe of version 3.3.16.0 and copy them into the corresponding folder of your 3.3.16.1 installation.
    1 point
  10. I was looking at something like this recently, just as a mental challenge, to use LoRa with an ESP32 to do remote commands across a bit of distance, or use SMS commands both ways with data using GSM/GPRS/LTE/5G backbone. I also purchased an SOS emergency call dongle for my elderly mother and looked on how easy it would be to write an interface to send the initial settings reliably and automatically for setup as the Chinglish documentation is quite non-specific with examples. Downloaded the documentation and thought there has to be a better way. Surely somebody has already done this? I was going to come over to the forums and have a peek at some serial routines, and saw this thread. Sorry to butt in, this post is not AutoIT related, but I have used MyPhoneExplorer for many, many years to send bulk SMS reliably from an Android phone. You will find it at www.fjsoft.at. Works great with simple cut and paste of text as well as destination phone numbers. It has other useful nifty features such as importing and exporting contacts (text and csv files are good for this), backup and generally is a well supported and reliable product. You may find that a cheapie Android phone with a USB cable or a LAN connection may be far more efficient than fiddling with Chinese hardware, reams of documentation, and reinventing the wheel. I don't have any skin in the product, but just recommend pre-loading it to anybody that has an Android phone and Windows PC - it may save you butt one day when you crack the screen and cannot see your display any more. All your settings, contacts, texts, tasks, calendar can be all saved in one swoop, and able to be transferred to a new phone. Whoosh! The time you save by using it can be spent doing other useful things such as writing code! Robust, reliable, and best of all, free! No adverts, no hassles, and intuitively works like you would expect such a package to work. The right tool for the job. This suggestion won't solve my issues and requirements, but it may thoroughly solve yours. ...now back to your scheduled headscratching/reverse engineering....
    1 point
  11. zcoacoaz

    AnimateWindow DLL Call

    look at what i came across on msdn its pretty cool $hwnd = GUICreate ( "Blend test", 300, 300 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000 ) GUISetState ( ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040001 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040002 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040004 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040008 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040005 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040006 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040009 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x0004000a ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1, "long", 0x00090000 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00040010 ) DllCall ( "user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00050010 )
    1 point
×
×
  • Create New...