tsue Posted January 3, 2017 Posted January 3, 2017 hello, i was wondering if there is a better way or a cleaner way to do this with relguar expressions #include <MsgBoxConstants.au3> #include <StringConstants.au3> $line = '<input type="checkbox" name="answers[b]" class="optInput" id="answers_b" /> <pre class="np">text/plain</pre>' $strLetterLeft = 'name="answers[' $strLetterRight = ']"' $findletter = StringRegExp($line, '\Q' & $strLetterLeft & '\E' & "(.*?)" & '\Q' & $strLetterRight & '\E' , 3, 1) For $i = 0 To UBound($findletter) - 1 $strAnswerLeft = '<pre class="np">' $strAnswerRight = '</pre>' $findanswer = StringRegExp($line, $strAnswerLeft & "(.*?)" & $strAnswerRight , 3, 1) For $i = 0 To UBound($findanswer) - 1 $stringrep2 = StringRegExpReplace($line, '<([^%]*?)/pre>', '<b>' & StringUpper($findletter[0]) & '.</b> ') $varStringFinal = $stringrep2 & '<span class="np">' & $findanswer[0] & '</span>' MsgBox(0, "replaced", $varStringFinal) Next Next
careca Posted January 6, 2017 Posted January 6, 2017 They already are regular expressions... Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
tsue Posted January 9, 2017 Author Posted January 9, 2017 On 6/1/2017 at 3:55 PM, careca said: They already are regular expressions... my bad i mean keeping regular expressions in the code. just to make the coding better or cleaner like a pro coder will do
careca Posted January 9, 2017 Posted January 9, 2017 Im not a pro coder, so i cannot help. Code seems good enough to me. XD Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
TheDcoder Posted January 10, 2017 Posted January 10, 2017 Maybe have a look at the Best Coding Practices EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
tsue Posted January 10, 2017 Author Posted January 10, 2017 6 hours ago, TheDcoder said: Maybe have a look at the Best Coding Practices wow what a great page thanks
TheDcoder Posted January 10, 2017 Posted January 10, 2017 27 minutes ago, tsue said: wow what a great page thanks My pleasure . EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion
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