There's nothing here yet
Recently Browsing 0 members
No registered users viewing this page.
I'm playing with SRE and trying to obtain some information from a test file.
I was testing the pattern on regex101, but when I bring it to AutoIt, it doesn't return the same result as on regex101.
I am surely (?:missing some important notes about PCRE engine|the pattern is not correct at all).
#include <Array.au3> #include <StringConstants.au3> Test() Func Test() Local $strFileName = @ScriptDir & "\TestFile.txt", _ $strFileContent, _ $arrResult $strFileContent = FileRead($strFileName) If @error Then Return ConsoleWrite("FileRead ERR: " & @error & @CRLF) $arrResult = StringRegExp($strFileContent, '(?sx)User:\h([^\n]+)\n' & _ 'Login\-name:\h([^\n]+)\n' & _ '(?:CaseSensitive:\h([^\n]+)\n)?' & _ 'NTSecurity:\h([^\n]+)\n' & _ '(?:NO\n)?' & _ '(?:Domain:\h([^\n]+)\n)?' & _ 'Timeout:\h([^\n]+)\n' & _ '.*?' & _ 'Member:\h([^\n]+)\n', $STR_REGEXPARRAYGLOBALMATCH) If IsArray($arrResult) Then _ArrayDisplay($arrResult) EndFunc Test file:
User: AMMINISTRATORE Login-name: ADM CaseSensitive: YES NTSecurity: NO NO Timeout: 00:05:00 Member: AMMINISTRATORI User: Test_User Login-name: Test_User NTSecurity: YES Domain: DNEU Timeout: 00:00:00 Member: OPERATORS Member: OPERATORS Any help (even from cats) it's highly appreciated.
I have a string like this :
Global $Msga = "urrent directory is /send. (Submission of file with log number 29381077284 is confirmed)";
I want to extract the number 29381077284 from the string. I did StringSplit to split based on "(" and then use space to reach there, But it's not a good choice.
Can anyone help me with regular expression to find the number from String using AutoIT. TIA
Thank you so much in advance for your help! I've been using AUTOIT for manipulating gcode. So far I've just worked through the excellent help examples and although I'm sure the resulting code is clumsy it has functioned
However now I'm trying to improve and advance things and I've stumbled across REGEX.. and I'm a bit stuck. What I would like to be able to do is to 'move'/'transform' the gcode in a file and re-write it to a new file. I only need to move it in one direction(X). At the heart of this I need a script to extract all the X values and then ADD or SUBTRACT an adjustment factor to transform and rewrite the code accordingly.
So far using an example script and an example input -
Local $iMove = -4
Local $sInput = '"G1 X45.036 Y6.934 F7800.000 G1 Z0.600 F7800.000 G1 F900 G1 X48.036 Y1.076 E0.58925"'
Local $sOutput = StringRegExpReplace($sInput, '(?<=[X])\d+.\d+', '\0')
This identifies the correct values i.e 45.036 and 48.036 but is there a way to dyamically adjust them before they are replaced, by for example a factor of -4 ($iMove above). So far I can't seem to do math on the '\0' value i.e '\0'+ -4 ?
Many thanks for your time and expertise!
I have this example string:
2020-06-08 09:23:33 : abcdefghifjklm How to trim just the right part? Or how to trim this text right to left?
I want to trim this string right to left until ' : '.
In ohter words: I need the 'abcdefghifklm' text.
I have tried StringTrimRight, but that requires
The number of characters to trim. Unfortunately StringSplit trims the left part of the strings.
This is my take on string triggers, triggers on specific strings.
Able to simple text pasting,
opening links (as long as there's a www. http:\\ or https:\\ at the beggining)
and is able to open applications, if there is a parameter in the parameter field, it uses it.
Shows your external, lan, and gateway ip's.
Able to change system volume by a set percentage, reading from the inputbox the number the user sets, if 0 or empty uses system default.
I made this because the existing string trigger applications didn't do it for me.
I did this for me, but if someone finds it useful, all the better.