Share this post

Link to post

Share on other sites

Melba23 2,461

What is the precise format you want? Is it a series of any number of letters, followed by either nothing or the digits "093"?

M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort---- Sort arrays on multiple columnsChooseFileFolder---- Single and multiple selections from specified path treeview listingDate_Time_Convert-- Easily convert date/time formats, including the language usedExtMsgBox--------- A highly customisable replacement for MsgBoxGUIExtender-------- Extend and retract multiple sections within a GUIGUIFrame---------- Subdivide GUIs into many adjustable framesGUIListViewEx------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx------ Check/clear parent and child checkboxes in a TreeViewMarquee----------- Scrolling tickertape GUIsNoFocusLines------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify------------- Small notifications on the edge of the displayScrollbars----------Automatically sized scrollbars with a single commandStringSize---------- Automatically size controls to fit textToast-------------- Small GUIs which pop out of the notification area

Share this post

Link to post

Share on other sites

Melba23 2,461

I have to keep reminding myself that just because you can do something with a RegEx, it does not always make sense to actually do so.

If you are not a guru in the blasted things, it is ofter easier (and faster!) to use other functions.

M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort---- Sort arrays on multiple columnsChooseFileFolder---- Single and multiple selections from specified path treeview listingDate_Time_Convert-- Easily convert date/time formats, including the language usedExtMsgBox--------- A highly customisable replacement for MsgBoxGUIExtender-------- Extend and retract multiple sections within a GUIGUIFrame---------- Subdivide GUIs into many adjustable framesGUIListViewEx------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx------ Check/clear parent and child checkboxes in a TreeViewMarquee----------- Scrolling tickertape GUIsNoFocusLines------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify------------- Small notifications on the edge of the displayScrollbars----------Automatically sized scrollbars with a single commandStringSize---------- Automatically size controls to fit textToast-------------- Small GUIs which pop out of the notification area

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

«^» Assert position at the beginning of a line (at beginning of the string or after a line break character)

«[[:alpha:]]» Match a single character in the range A to Z or a to z

«[[:alnum:]]{0,19}» Match a single character present in the range A to Z or a to z or 0 to 9 as many times as posible, between zero and 19 times

«$» Assert position at the end of a line (at the end of the string or before a line break character) i.e. make sure all characters are include in the match

Edited February 3, 2010 by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post

Link to post

Share on other sites

Malkey 140

Local$sMessage,$sResultsLocal$aTestString[8][2]=[["asdzcasddzc","OK"],["asdjasd02389","OK"],["asd90asd90","OK"],_["231321asd","NOT OK"],["90423jr)(*","NOT OK"],["asdasdasd*&","NOT OK"],_["asd90asd90asd","NOT OK"],["asdzcasddzc12345678910","NOT OK"]]For$i=0ToUBound($aTestString)-1$sMessage="NOT OK"If(StringRegExp($aTestString[$i][0],"^[a-z]")AndStringRegExp($aTestString[$i][0],"\d$"))And_; If start with letter & end with digit - okStringLen($aTestString[$i][0])<=20Or_; If less than or equal to 20 characters - ok(StringRegExp($aTestString[$i][0],"[^a-z]")=0)Then$sMessage="OK"; If only letters - ok$sResults&=$aTestString[$i][0]&@TAB&$aTestString[$i][1]&" expected. Result is "&$sMessage&@CRLFNextMsgBox(0,"Results",$sResults)