RESTRICT EDIT UDF
Restrict the text that can be entered in an editbox through a String Regular Expression.
The UDF works be subclassing the control. >Here is a similar UDF based on Windows Message.
The UDF is pretty simple and could be modified with ease. User can set their SRE pattern to block the text entered in the editbox Tooltips can be used in case of an error. The title of the Tooltip is Error_2 where the number(2) signifies the pattern that caused the error. The script is made to use function pointer variables rather than direct patterns, to make it more flexible and broader. Supports +ve and -ve SRE pattern matches. See example for better understanding.
Note : The Pattern should be made such that every phase of typing is met,
Example, if the user wants The second letter should be always a digit. Then he should make sure that the pattern is also satisfied when user enters the first character, as through the process of typing.
; #INDEX# ======================================================================================================================= ; Title .........: RestrictEdit ; Version........: 1.0 ; AutoIt Version : 188.8.131.52++ ; Language ......: English ; Author(s)......: Phoenix XL ; Librarie(s)....: WinAPI, Array and GUIEdit ; Description ...: Functions for restricting the text typed in an Edit control through SRE. ; The edit control is subclassed and the original processing is blocked when pattern isn't satisfied. ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_Restrict_Edit ; =============================================================================================================================== ; #INTERNAL_USE_ONLY# =========================================================================================================== ; HideToolTip_Edit ;_NewWnd_Proc_ ;_SubClass_ ; =============================================================================================================================== ChangeLog
v1.0 - First Release
v2.0 - Replaced the SRE pattern parameter(2nd parameter) with function pointer parameter[A script Breaking change]. Added support for positive and negative pattern matches
Previous downloads : 161
Come up with a different regular expression, maybe improved?
#include <Array.au3> #include <Inet.au3> Local $aSRE = StringRegExp(_INetGetSource('http://www.telize.com/geoip'), '"\w+":"?([^",]+)', 3) _ArrayDisplay($aSRE)
Could someone make a pattern for this. Been testing out various patterns for hours.
<div class="profName"><a href="ShowRatings.jsp?tid=1632499">Abaquita, Edwin</a></div>
I just need the name (Abaquita, Edwin). The problem with my pattern is the link number (1632499) changes with every name and there are multiple names on a page, also the number of digits varies with each name.
Thank you in advance.