Jump to content

Recommended Posts

11 hours ago, argumentum said:

why Func _ReduceMemory() ?.
I believe it'd be better without it.

Thanks for sharing.

Is far as I know it compres the used memory.

Why do you believe it's better without it?

Share this post


Link to post
Share on other sites

It's not needed because it actually makes your script much slower with a large amount of data. What this function does is takes the memory used by the program and dumps it to disk in the page file. Reading data from a file is many times slower than reading the same data from memory. Also, having more free memory means that all the money you spent on that 16Gbs of memory was a waste, because you're not actually using it. This was a useless holdover from the XP days, and wasn't even needed back then either.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

@argumentum thank for letting me know.

@BrewManNH thanks for explaining it, I used it in a lot of script and with this in mind I will get rid of this chunck of code.

Edited by nend

Share this post


Link to post
Share on other sites

Seems to be a very handy RegEx tool. :thumbsup:

My three suggestions:

  1. import text from clipboard
  2. resizeable GUI for larger edit controls
  3. show/hide functionality of the right help panel to make the GUI more compact

 

Drag'n drop doesn't load the text file.


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
3 hours ago, UEZ said:

Seems to be a very handy RegEx tool. :thumbsup:

My three suggestions:

  1. import text from clipboard
  2. resizeable GUI for larger edit controls
  3. show/hide functionality of the right help panel to make the GUI more compact

 

Drag'n drop doesn't load the text file.

Thanks!!

1. import text from clipboard

Good idea!

2. resizeable GUI for larger edit controls

I've tryed that but the "Regular expression output data" edit control wouldn't resize right, I think it has something to do this one is the middle.

3. show/hide functionality of the right help panel to make the GUI more compact

Also a good idea, I will look into it

Drag'n drop doesn't load the text file.

The drag'n drop is only for the export file to import (*.ini file)

Share this post


Link to post
Share on other sites

Hi there, could this tool generate autoit code from this tool?

I'm using the match and replace option and then manually writing StringRegExpReplace() function, but the code does not work as described in the Regex toolkit, presumably I don't know what function I should use, hence the request

 

Share this post


Link to post
Share on other sites
On 1-12-2017 at 1:07 AM, NDog said:

Hi there, could this tool generate autoit code from this tool?

I'm using the match and replace option and then manually writing StringRegExpReplace() function, but the code does not work as described in the Regex toolkit, presumably I don't know what function I should use, hence the request

 

I made a new version where this is possible, see the latest version (V1.3.0).

Share this post


Link to post
Share on other sites

I rewrote the program StringRegExpGui that is distributed with AutoIT3 and can be found in the \Examples\Helpfile folder. The RegExGui published today is a total remake and offers the following improvements:

Examples
Built-in and instant accessible with a menu. There are six instructional applications for finding names, phone numbers, dates, and the like. The direct and fast operation allows the user to take the lead in the little-practiced box of pattern recognition. Thanks FritsW.

Daring
All examples start with multiple finds that match the specified pattern. In addition, each match is immediately shown and dissected into parts. This is in contrast to software that starts with a single match or just the observation that a match has taken place. With the direct approach, the user jumps straight into the deep and can simplify the example as desired. This depth with RegExGui gives the best preparation for practical use.

User-friendly
On the screen is a ruler with numbers, so that an unexpected error in the manufacture of a pattern is now more quickly solved. Added are a number of tooltips. At will, the user can adjust and / or save the sample patterns.

Growth
The examples include links to sites that explain advanced regular expressions or provide tools. Furthermore, a link to a site for healthy food. Thanks JolandeS.

The width of the dialog window of the program is adjustable. As patterns are better controlled, the user may want to go to long expressions. They can then remain completely in the picture. Thanks Melba23.

Presentation
Multiple results are presented in a two-dimensional way. Each match at the beginning of a line, optional decomposition of components in subsequent columns. As a result, a match will continue to be distinguished from a part that belongs to another match.

The program now has a 256-bit icon with alpha transparency.

Bright
Textual explanations are given with the results. A lime background color is chosen for the status field. This improves the contrast. Thanks EmileR.

Repair of errors
A diagnosis has now been made regarding the exchange of detail - with primary match data in the results, when using the options Match and All matches. Until it is repaired, users can use the Match + detail and Ales Matches + details options.

A bug in StringRegExpGui - the unexpected disappearance of all saved patterns - has been fixed. Thank LeaB. With RegExGUi, the patterns remain in the inifile in the same folder as the program.

Happy
Few users are aware of the invisibly different codings of the alphabet hidden under water in text files. Since the new millennium the use of unicode has been growing, it has many advantages. Here and there are 8 bit codings. They traversed searching in the past and especially finding it. Again without users knowing this, they have only experienced fruitlessness. The RegExGui presented here relieves the user for that matter in the whole. The program takes care of encoding and always comes up with the most complete results that fit your pattern, thanks DominiqueH.

Efficient code
Compared to the StringRegExpGui, the source code of RegExGui is shorter.

      Bert Kerkhof, analyst and programmer

      Download: https://github.com/BertKerkhof/RegExGui   

Please comment
 

RegExGui.source.au3

Share this post


Link to post
Share on other sites

Dear Nend,

After uploading RegExGui yesterday, I saw your RegEx toolkit and looked at it.

All praise for the fold-out window with the handy reminder of RegEx codes. Nend is looking for new ways to draw attention to an error in the specified pattern through the color of the pattern field. This is interesting.

A try of entering text data via a website url was not successful, the program breaks down.

For making multiple matches, the toolkit has chosen 'Array of matches'. When you take the example "Time" from RegExGui into the toolkit, the output box shows 11 numbers instead of 5 matches. Making something usefull from these 11 numbers is not possible. It happens that string parts have been requested in the pattern string, nevertheless, these parts occur in many patterns. Suggestion is the use in the toolkit of 'Array of matches and details' as the supreme method for multiple matches.

Good idea to include the Replace option in the toolkit. The option immediately demonstrates the usefulness of requesting string sections: with  use of parameters $1 $2 $3, parts of the match can come back up in the output. For example: use the "Date" example and then fill in the Replace field "$2 $1th" (without quotes). Then "17 Apr 1997" changes to "Apr 17th".

The examples built into RegExGui help users cross a threshold. Feel free to take over my examples in the toolkit. The point is that regular expressions should be better utilized: IT gives programmers power.

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By cruisepandey
      Hi, 
      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
    • By Chimp
      Hello
      if I have a string like in the example below,
      is there a regular expression that can surround any "string" (and only strings) within quotes?.
      The whole input string is a "constructor" to populate an array so even if an element contains more words (a phrase) it should be considered as a single word (Elton John should be considered a single word and as that quoted as "Elton John")
      for example
      the following string
      [[Elton John,Peter,Sally,123],[1 one 1,2,3,4 four 4]] should be transformed to this other string
      [["Elton John","Peter","Sally",123],["1 one 1",2,3,"4 four 4"]] Thanks for your help
      Here a small script to use as "guinea pig"
      #include <Array.au3> Local $aArray = [["Elton John", "Peter", "Sally", 123],["one 1", 2, 3, "4 four 4"]] MsgBox(0, "Result", _Array2Json($aArray)) Func _Array2Json($aArray) If (Not IsArray($aArray)) Or (UBound($aArray, 0) > 2) Then Return SetError(1, 0, '') Local $sOpening, $sClosing If UBound($aArray, 0) = 1 Then $sOpening = '[' $sClosing = ']' Else $sOpening = '[[' $sClosing = ']]' EndIf $sOutpt = $sOpening & _ArrayToString($aArray, ",", -1, -1, "],[") & $sClosing ; $sOutpt = ???? how to quote strings ???? Return $sOutpt EndFunc ;==>_Array2Json  
    • By genius257
      Inspired by PHP's preg_split.
      Split string by a regular expression.
      Also supports the same flags as the PHP equivalent.
      v1.0.1
       
      Example:
      #include "StringRegExpSplit.au3" StringRegExpSplit('splitCamelCaseWords', '(?<=\w)(?=[A-Z])') ; ['split', 'Camel', 'Case', 'Words']  
    • By lee321987
      Hello, I'm trying to match the second to last line of this:
      foo C:\ foobar foobar x C:\temp\dir Last line with chars Here's my code:
      $test = 'foo' & @CRLF $test &= 'C:\' & @CRLF $test &= 'foobar' & @CRLF $test &= 'hello' & @CRLF $test &= 'C:\temp\dir' & @CRLF $test &= 'Last line with chars' & @CRLF $test &= @CRLF $test &= @CRLF $result = StringRegExp($test, '(?m)^C:\\.*$Last.*') MsgBox(0, '', $result) I'm trying to match line "C:\temp\dir".  Anyone have any ideas?
    • By therks
      I'm looking for a regex genius, cus I'm stumped when it comes to assertions.
      So what I have now, is this regular expression: ([^|=]+)=([^|]+)
      It takes a string (user input) of keys=values separated by pipes (ie: "param=value|param=value") and splits them into an array.
      Example:
      $vParamData = 'example=value|fruit=apple|phrase=Hello world' $aRegEx = StringRegExp($vParamData, '([^|=]+)=([^|]+)', 3) ; Result ; [0] => example ; [1] => value ; [2] => fruit ; [3] => apple ; [4] => phrase ; [5] => Hello world So that's working fine, but I'm wondering if there's also a way I could have this capture escaped pipes instead of splitting by them.
      ie:
      $vParamData = 'pipe test=this \| is a pipe|example=value' $aRegEx = StringRegExp($vParamData, '([^|=]+)=([^|]+)', 3) ; I'm getting this: ; [0] => pipe test ; [1] => this \ ; [2] => example ; [3] => value ; But I'd like a result like this: ; [0] => pipe test ; [1] => this \| is a pipe ; [2] => example ; [3] => value Is there some pattern that would accomplish this, or am I better off parsing it some other way?
×
×
  • Create New...