tezhihi

StringRegExReplace in File.

57 posts in this topic

#1 ·  Posted

I have a file (see attached file) with a string all line and this problem on here is I want to separate all $00:, $03:, $10:, $20:, $25:, $30:, $40:, $45:, $110:, $115:, $120: and $T. It's mean that each $ with value start a new line ( a new paragraph). I tried with Regular Expression in notepad++ ex:

Find ($00:, $01:, $03: and so on) with regex (\$)([0-9]+): and replace is \r\n\1\2 (I think \r\n is @CRLF (not sure :() )

Find $T with regex (\$T)(.*?)(\$T) and replace is \1\2\r\n\3

When I try these regex to replace in notepad on StringRegexReplace the results is incorrect :(. I have read some example simple about regex. Please advise me how to do that with some example on autoit :(. The result will be in attached photo. Thanks 

ahihi.txt

result.png

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

aaaa

Edited by tezhihi

Share this post


Link to post
Share on other sites

#3 ·  Posted

@tezhihi please wait 24 hours before bumping your thread. All of our forum members assist as they are able, and not all are in the same time zone; the person best able to assist you may not be online right now.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#4 ·  Posted

11 minutes ago, JLogan3o13 said:

@tezhihi please wait 24 hours before bumping your thread. All of our forum members assist as they are able, and not all are in the same time zone; the person best able to assist you may not be online right now.

Sorry about that. Thanks you

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

What about this ?

$txt = FileRead("ahihi.txt")

$output = StringRegExpReplace($txt, '(?<!^|:)(?=\$(?:00|03|10|20|25|30|40|45|110|115|120|T))', @crlf)
FileWrite("output.txt", $output)

Meaning :
Search positions (not preceded by start of text or a colon) and (followed by $00, $03 and so on)
and at these positions insert a crlf
:)

Edited by mikell
1 person likes this

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

10 hours ago, mikell said:

What about this ?

$txt = FileRead("ahihi.txt")

$output = StringRegExpReplace($txt, '(?<!^|:)(?=\$(?:00|03|10|20|25|30|40|45|110|115|120|T))', @crlf)
FileWrite("output.txt", $output)

Meaning :
Search positions (not preceded by start of text or a colon) and (followed by $00, $03 and so on)
and at these positions insert a crlf
:)

Awesome. I have a more question.

I want to link between 2 $ with text below:

$F$%$?$%- - - - - - - - - - - - - - - - - -Footnotes- - - - - - - - - - - - - - - - - -
$Tn1 Subsequent to oral argument by letter, dated December 16, 2005 Scrushy's attorney submitted to the Court a "Memo" dated 7/19/04 and apparently prepared by a Pamela Anderson. This "Memo" contains unverified, unsworn rank hearsay and the Court has not considered the contents of this document in reaching its decision.$%$?$%- - - - - - - - - - - - - - - - -End
 Footnotes- - - - - - - - - - - - - - - - -$E$=P1298*3

$F with $Tn1 and Delete $%$?$%- - - - - - - - - - - - - - - - -End Footnotes- - - - - - - - - - - - - - - - -             and the result should be 

$F$Tn1 Subsequent to oral argument by letter, dated December 16, 2005 Scrushy's attorney submitted to the Court a "Memo" dated 7/19/04 and apparently prepared by a Pamela Anderson. This "Memo" contains unverified, unsworn rank hearsay and the Court has not considered the contents of this document in reaching its decision.$E$=P1298*3

Kindly check and advise me. Thanks you

Edited by tezhihi

Share this post


Link to post
Share on other sites

#7 ·  Posted

Here it is

$str = '$F$%$?$%- - - - - - - - - - - - - - - - - -Footnotes- - - - - - - - - - - - - - - - - -' & @crlf & _ 
'$Tn1 Subsequent to oral argument by letter, dated December 16, 2005 Scrushy''s attorney submitted to the Court a "Memo" dated 7/19/04 and apparently prepared by a Pamela Anderson. This "Memo" contains unverified, unsworn rank hearsay and the Court has not considered the contents of this document in reaching its decision.$%$?$%- - - - - - - - - - - - - - - - -End' & @crlf & _ 
' Footnotes- - - - - - - - - - - - - - - - -$E$=P1298*3'

;msgbox(0,"", $str)

$str2 = StringRegExpReplace($str, '\$%\$\?\$%[^\$]+', "")
msgbox(0,"", $str2)

This removes any non-$ char from "$%$?$%" up to the next $ char
Please note that you have to first manage the single quote(s) included in the string
:)

1 person likes this

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

58 minutes ago, mikell said:

Here it is

$str = '$F$%$?$%- - - - - - - - - - - - - - - - - -Footnotes- - - - - - - - - - - - - - - - - -' & @crlf & _ 
'$Tn1 Subsequent to oral argument by letter, dated December 16, 2005 Scrushy''s attorney submitted to the Court a "Memo" dated 7/19/04 and apparently prepared by a Pamela Anderson. This "Memo" contains unverified, unsworn rank hearsay and the Court has not considered the contents of this document in reaching its decision.$%$?$%- - - - - - - - - - - - - - - - -End' & @crlf & _ 
' Footnotes- - - - - - - - - - - - - - - - -$E$=P1298*3'

;msgbox(0,"", $str)

$str2 = StringRegExpReplace($str, '\$%\$\?\$%[^\$]+', "")
msgbox(0,"", $str2)

This removes any non-$ char from "$%$?$%" up to the next $ char
Please note that you have to first manage the single quote(s) included in the string
:)

Can I search the string "$=<$=T3*1 $=L00180000845001096*001106" on regex

1.  "\$=<\$=T([0-9]+)\*([0-9]+)\s\$=L.+?\*(([0-9]+){6})"

or

2. "\$=<\$=T[^\$]+\$=L[^\$]+"

I want to remove it :)

Edited by tezhihi

Share this post


Link to post
Share on other sites

#9 ·  Posted

I saw that this string exists (with various flavours) several times in the file. To remove them all you might use a more selective expression to limit the risk of errors

StringRegExpReplace($str, '\$=<\$=T3\*1\s+\$=L\d+\*\d+', "")

:)

1 person likes this

Share this post


Link to post
Share on other sites

#10 ·  Posted

28 minutes ago, mikell said:

I saw that this string exists (with various flavours) several times in the file. To remove them all you might use a more selective expression to limit the risk of errors

StringRegExpReplace($str, '\$=<\$=T3\*1\s+\$=L\d+\*\d+', "")

:)

Oh thanks youuuu so much.

He received the following bonuses for the years shown:$M05,06,13,13,13,33$GFOR$JANNUAL$JTARGET$JTOTAL$JDESCRIPTION$GYEAR$JBONUS$JBONUS$JINCENTIVE$G$J$J$JBONUS$D$Q2002$B$ 10,000,000$B$ 1,200,000$Y$ 11,200,000$BAnnual Bonus in and for 2002$Q$B$B$Y$Balso paid in 2002. Net income$Q$B$B$Y$Bwas negative $ (467 million.)$Q$B$B$Y$BApproved by the Compensation$Q$B$B$Y$BCommittee on April 29, 2002.$Q$Q2001$B$ 6,500,000$B$ 2,400,000$Y$ 8,900,000$BNet income for 2001 was negative$Q$B$B$Y$B$ (191 million). Bonuses$Q$B$B$Y$Breported in the proxy filed$Q$B$B$Y$BApril 12, 2002.$Q$Q2000$BNone.$B$ 2,154,849$Y$ 2,154,849$BNet income for 2000 was a$Q$B$B$Y$Bnegative $ (364 million).$Q$Q1999$BNone.$B$ 134,031$Y$ 134, 031$BFinancials fraudulent but no$Q$B$B$Y$Baudited restatement.$Q$Q1998$BNone.$B$ 1,577,829$Y$ 1,577,829$BFinancials fraudulent but no$Q$B$B$Y$Baudited restatement.$Q$Q1997$B$ 10,000,000$B$ 2,400,000$Y$ 12,400,000$BAnnual Bonus was reported in$Q$B$B$Y$Bproxy dated April 17, 1998, as$Q$B$B$Y$Bbeing for and earned in 1997.$Q$Q1996$B$ 8,000,000$B$ 2,400,000$Y$ 10,400,000$BAnnual Bonus was reported in$Q$B$B$Y$Bproxy dated April 9, 1997, as$Q$B$B$Y$Bbeing for, and earned in, 1996.$Q$QTotal$B$ 34,500,000$B$ 12,266,709$Y$ 46,766,709$BBefore Prejudgment Interest$X$=P1298*7 $T5. In each annual proxy on Form 14A, HealthSouth disclosed the following criteria for Incentive Bonuses paid to its executives:$=S$%$?$%Incentive Compensation: In addition to base salary, the $(Compensation$) Committee recommends to the Board of Directors cash incentive compensation for HealthSouth's executives, based on each executive's success in meeting qualitative and quantitative performance goals on an annual basis.

Are I correct if i use these code below:

StringRegExpReplace(FileRead("ahihi.txt"), '(?=\$(?:M))', @crlf)     ;For create a new paragraph with $M (ex: $M05,06,13,13,13,33$GFOR$JA ......)
StringRegExpReplace(FileRead("ahihi.txt"), '\$=P\d+\*\d+', '')       ;For remove all $=P1298*x
StringRegExpReplace(FileRead("ahihi.txt"), '\$=>', '')               ;For remove all $=>

 

Share this post


Link to post
Share on other sites

#11 ·  Posted

Yes you are. They will all work correctly, some remarks yet :

The first one will insert a crlf just before any $M encountered, so it could be done a little simpler

StringRegExpReplace(FileRead("ahihi.txt"), '(?=\$M)', @crlf)

If the second one is made to remove all "$=P1298*x" precisely then it could be done more selective - which is always a good idea when using regex

StringRegExpReplace(FileRead("ahihi.txt"), '\$=P1298\*\d+', '')

Nothing to say about the third  :)

1 person likes this

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

On 5/6/2017 at 1:49 AM, mikell said:

Yes you are. They will all work correctly, some remarks yet :

The first one will insert a crlf just before any $M encountered, so it could be done a little simpler

StringRegExpReplace(FileRead("ahihi.txt"), '(?=\$M)', @crlf)

If the second one is made to remove all "$=P1298*x" precisely then it could be done more selective - which is always a good idea when using regex

StringRegExpReplace(FileRead("ahihi.txt"), '\$=P1298\*\d+', '')

Nothing to say about the third  :)

Case 1:

After I used the code below:

#include <File.au3>
$a = FileRead(@ScriptDir & '\ahihi.txt')
$b = StringRegExpReplace($a, '(\$%\$\?\$%)(?=\$=B)', '\1' & @CRLF & '\2')
$c = StringRegExpReplace($b, '\$%\$\?\$%[^\$]+', "")
$d = StringRegExpReplace($c, '(?<!^|:)(?=\$(?:00|01|03|10|20|25|30|40|45|110|115|120|T|F|200|220))', @crlf)
$e = StringRegExpReplace($d, '(?=\$M)', @crlf)
$f = StringRegExpReplace($e, '(\$F)(\R)(\$Tn)', '\1\3')
$g = StringRegExpReplace($f, '\$=<\$=T\d+\*\d+\s+\$=L\d+\*\d+', '')
$h = StringRegExpReplace($g, '\$=P\d+\*\d+', '')
$i = StringRegExpReplace($h, '(\$E)\$%\$\?\$%(\$=B)', '')
$j = StringRegExpReplace($i, '\$I\s+\$U', '$I$U')
$k = StringRegExpReplace($j, '\$=>', '')
FileWrite("output.txt", $k)

Output file has been appeared problem (please see in the red box on image ____ All $T with symbol ' : ' ). I think this problem will be solve when i use code below:

Untitled-2.png

StringRegExpReplace(FileRead("ahihi.txt"), '(\:)(\$T)(\$=B)', '\1' & @CRLF & '\2\3')

StringRegExpReplace(FileRead("ahihi.txt"), '([a-z]+)(\:)(\$T)', '\1\2' & @CRLF & '\3')

Otherwise, please advise me.

 

Case 2:

$str = '$T$F$%$?$%- - - - - - - - - - - - - - - - - -Footnotes- - - - - - - - - - - - - - - - - - n1 Liggett has been rewarded handsomely in the settlement with the Attorneys General for its historic cooperation. $%$?$%- - - - - - - - - - - - - - - - -End Footnotes- - - - - - - - - - - - - - - - -$E'   ;This is one line not include @CRLF

$str2 = StringRegExpReplace($str, '\$%\$\?\$%[^\$]+', "")

The results is ' $F$E ' not include text data inside.

I will resolve it as code below:

$str = '$T$F$%$?$%- - - - - - - - - - - - - - - - - -Footnotes- - - - - - - - - - - - - - - - - - n1 Liggett has been rewarded handsomely in the settlement with the Attorneys General for its historic cooperation. $%$?$%- - - - - - - - - - - - - - - - -End Footnotes- - - - - - - - - - - - - - - - -$E'

$str2 = StringRegExpReplace($str, '(\$%\$\?\$%[^\$]+)(n\d+)', '\2')

Otherwise, please advise me.

Edited by tezhihi

Share this post


Link to post
Share on other sites

#13 ·  Posted

The case 2 could be done like this

StringRegExpReplace($str, '\$%\$\?\$%.+?(?=n\d|\$)', "")

For case 1 this is possible

StringRegExpReplace($str, '(?<=:)(?=\$T\$=B)', @CRLF)

But it becomes a little difficult for me as I don't know exactly which "$x" things you want to keep and which ones you want to remove :sweating:
Maybe all this could be done simpler depending on what should be the final result after complete treatment of the initial file

1 person likes this

Share this post


Link to post
Share on other sites

#14 ·  Posted

@tezhihi

6 hours ago, mikell said:

Maybe all this could be done simpler depending on what should be the final result

For instance could this be correct ?

$s = FileRead(@ScriptDir & '\ahihi.txt')
$s = StringRegExpReplace($s, '\R|(\$F)?\$%\$\?\$%[^\$]*', "")  ; footnotes
$s = StringRegExpReplace($s, '(?<!^|:)(?=\$(?|00|01|03|10|20|25|30|40|45|110|115|120|200|220|T|M))', @crlf)
$s = StringRegExpReplace($s, '(\$(?|[DXOENUI\?%]|=[BRIS<>]|=[PLT]\d+\*\d+))+', "")
$s = StringRegExpReplace($s, '(\$[MBJGQY])+', " ")

$s = StringRegExpReplace($s, '\$T', "")
FileWrite("output.txt", $s)

 

1 person likes this

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

13 hours ago, mikell said:

@tezhihi

For instance could this be correct ?

$s = FileRead(@ScriptDir & '\ahihi.txt')
$s = StringRegExpReplace($s, '\R|(\$F)?\$%\$\?\$%[^\$]*', "")  ; use this code will be deleted some text data
$s = StringRegExpReplace($s, '(?<!^|:)(?=\$(?|00|01|03|10|20|25|30|40|45|110|115|120|200|220|T|M))', @crlf) 
$s = StringRegExpReplace($s, '(\$(?|[DXOENUI\?%]|=[BRIS<>]|=[PLT]\d+\*\d+))+', "") ; use this code will delete all $ with value. Each $ corresponding with font or indent at start paragraph and some others data.
$s = StringRegExpReplace($s, '(\$[MBJGQY])+', " ") ; just make a new paragraph start with $M and end with $X. I will modify after replace all done

$s = StringRegExpReplace($s, '\$T', "") ; $T is segment required in text file = indent at start paragraph
FileWrite("output.txt", $s)

 

@mikell oh no :( the result of output will be same with the result from output.txt of my code :(. Please see remark on your code.

 

I will send you the list of data need to delete in text file. Please see  new 2.txt     

I have multiple file like that for modify. I need to make a tool for un string all of them. Please check the correctness of the code below

#include <File.au3>
$a = FileRead(@ScriptDir & '\ahihi.txt')
$a = StringRegExpReplace($a, '(\$%\$\?\$%)(?=\$=B)', '\1' & @CRLF & '\2')
$a = StringRegExpReplace($a, '(\$%\$\?\$%[^\$]+Footnotes[^\$]+)(n\d+)', '\2')
$a = StringRegExpReplace($a, '\$%\$\?\$%[^\$]+Footnotes[^\$]+', '')
$a = StringRegExpReplace($a, '(\$%\$\?\$%[^\$]+)(\$E)', '\2')
$a = StringRegExpReplace($a, '(?<!^|:)(?=\$(?:00|01|03|10|20|25|30|40|45|110|115|120|T|F|200|220))', @CRLF)
$a = StringRegExpReplace($a, '(?=\$M)', @CRLF)
$a = StringRegExpReplace($a, '(?=\$=S)', @CRLF)
$a = StringRegExpReplace($a, '(?=\$%\$\?\$%)', @CRLF)
$a = StringRegExpReplace($a, '(\$F)(\R)(\$Tn)', '\1\3')
$a = StringRegExpReplace($a, '(\$T)(\R)(\$F)', '\3\1')
$a = StringRegExpReplace($a, '(\s)(\$E)', '\2')
$a = StringRegExpReplace($a, '\$=<\$=T\d+\*\d+\s+\$=L\d+\*\d+', '')
$a = StringRegExpReplace($a, '\$=<\$=T\d+\*[^\$]+\$=L\d+\*\d+', '')
$a = StringRegExpReplace($a, '\$=P\d+\*\d+', '')
$a = StringRegExpReplace($a, '(\$E)\$%\$\?\$%(\$=B)', '')
$a = StringRegExpReplace($a, '\$I\s+\$U', '$I$U')
$a = StringRegExpReplace($a, '\$=>', '')
$a = StringRegExpReplace($a, '(?<=:)(?=\$T\$=B)', @CRLF)
$a = StringRegExpReplace($a, '([A-Z][a-z].+\:)(\$T)', '\1' & @CRLF & '\2')
$a = StringRegExpReplace($a, '(\$E)(\$=B)', '\1' & @CRLF & '\2')
$a = StringRegExpReplace($a, '(\$00:)(.+)', '\1')
$a = StringRegExpReplace($a, '\$03:.+\R', '')
$a = StringRegExpReplace($a, '\$30:.+\R', '')
$a = StringRegExpReplace($a, '(\$200:)(.+)', '\1')
$a = StringRegExpReplace($a, '(\$%\$\?\$%)(\R)(\$=B)', '\1\3')
$a = StringRegExpReplace($a, '(\$120:)(\R)(\$T)', '\1\3')
$a = StringRegExpReplace($a, '(\$120:)(\R)(\$%\$\?\$%)', '\1\3')
$a = StringRegExpReplace($a, '(\$120:\$%\$\?\$%)(\R)(\$=B)', '\1\3')
$a = StringRegExpReplace($a, '(\$=S)(\R)(\$%\$\?\$%)', '\1\3')
$a = StringRegExpReplace($a, '(\$%\$\?\$%)(\s)', '\1')
$a = StringRegExpReplace($a, '(\$01:.+)(\R\$%\$\?\$%.+)', '\1')
$a = StringRegExpReplace($a, '\$(?|=L\d+\*\d+)', '')
FileWrite("output.txt", $a)

 

Edited by tezhihi

Share this post


Link to post
Share on other sites

#16 ·  Posted

@mikell follow up :( need your help

Share this post


Link to post
Share on other sites

#17 ·  Posted

I do follow... my previous post was just a little play - because obviously you need a final file with a very particular formatting
I tried to guess the signification of the various $x (i.e. $F = Footnotes, and so on) but I quickly gave up :sweating:
Actually you have a bunch of SRER and some of them are redundant , but they are not so bad and they do the job
To help you I need precise infos... the best would be to build manually a final file, so when comparing I can know exactly what you want :)

 

1 person likes this

Share this post


Link to post
Share on other sites

#18 ·  Posted

1 hour ago, mikell said:

I do follow... my previous post was just a little play - because obviously you need a final file with a very particular formatting
I tried to guess the signification of the various $x (i.e. $F = Footnotes, and so on) but I quickly gave up :sweating:
Actually you have a bunch of SRER and some of them are redundant , but they are not so bad and they do the job
To help you I need precise infos... the best would be to build manually a final file, so when comparing I can know exactly what you want :)

 

@mikell Ok i will send for you the completed file for compare when im in office. This file completed with the best person. I will send you the full information for processing with regex with all take note of them. :) 

 

 

Share this post


Link to post
Share on other sites

#19 ·  Posted

Nice. The more I have infos, the more I can make suggestions  :)

1 person likes this

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

6 hours ago, mikell said:

Nice. The more I have infos, the more I can make suggestions  :)

Hi @mikell can you check the For Mikell.xls file with remark and check EXAMPLE.TXT (This is Results of ahihi.txt) and help me. If you need more information please advise me.

Oh I have a new one file for you to try processing: New For Process.txt

Edited by tezhihi

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

  • Similar Content

    • TheAutomator
      By TheAutomator
      Can anyone tell me why this isn't working?..
      #include <array.au3> $regexp = StringRegExp("test 'a b c'", "'([^']|'')*'|\S+", 3) _ArrayDisplay($regexp) trying to split this "test 'a b c'  'some other '' test'' ...'" into:
      0: test
      1: 'a b c'
      2: ...
      but it gives me:
      0: test
      1: c
    • anthonyjr2
      By anthonyjr2
      Hi guys,
      I am pretty bad with regex, and am having some trouble trying to come up with an expression for a certain type of string. Basically I want to be able to tell if a string is of the format:
      AA#####A
      Where the A's are any letter from A-Z and the #'s are any digit from 0-9.
      I've been playing around with a regex tester online for a while but I can't really seem to grasp the concept very well. Could anyone give me any tips?
      This isn't exactly an AutoIt specific question which is why I didn't post it in General Help & Support.
    • MyEarth
      By MyEarth
      Hello, i need to validate a string can be different things. I just need a True - False return value, no groups or things like that. It will be always one line at time to be processed by StringRegEx
      Valid:
      13:52|String
      02:52 XX|String
      13:52~SUN, MON, TUE, WED, THU, FRI, SAT|String
      02:52 XX~SUN, MON, FRI|String
      22/04/2017 13:52|String
      22/04/2017 02:52 YY|String
      Not Valid
      22/04/2017 13:52~Dom|String
      I need to validate until and inclusively the | after that i don't care
      The XX and YY value are two $sVariable from my script
      SUN, MON, TUE, WED, THU, FRI, SAT are fixed value, the can be mixed but always in the same order like
      SUN
      SUN, TUE, WED
      SUN, SAT 
      The time can be 12 or 24 hours, the date is always in the same format DD/MM/YYYY. If there is a date can't be a day after that ( see not valid )
      Well i think is all
      Sorry if i don't provide a working code, regex is too way complex.
      Thanks
    • DavidLago
      By DavidLago
      Hello. 
      I need to list only the folders that has a name composed of numbers only.
      How do I do this?
      OBS: I just posted the relevant content to the folder.
      Global $path = "G:\jobs\" For $i = 1 To $aArray[0] Local $search = FileFindFirstFile($path & $aArray[$i] & "\[0-9]" ) I tried with "\*.*" and it returns me the expected result, but the other doesn't.
    • nikink
      By nikink
      Hi all, it's been a while since I last used regular expressions and I find myself out of time to experiment with this particular issue, so I throw myself upon your mercy and expertise.
      I am looking to create a function that will say whether or not a supplied string is a valid UUID or not.
      Local $sTestF = '4C4C4544-004A-4C10-8054-B7C04F46343' Local $sTestT = '4C4C4544-004A-4C10-8054-B7C04F463432' ConsoleWrite('False = ' & _IsValidUUID($sTestF) & @CRLF) ConsoleWrite('True = ' & _IsValidUUID($sTestT) & @CRLF) Func _IsValidUUID($sUUID) ;[\p{XDigit}]{8}-[\p{XDigit}]{4}-[34][\p{XDigit}]{3}-[89ab][\p{XDigit}]{3}-[\p{XDigit}]{12} ; Test UUID = '4C4C4544-004A-4C10-8054-B7C04F463432' Local $sRegExp = '([:xdigit:]){8}\-([:xdigit:]){4}\-([34])([:xdigit:]){3}\-([89ab])([:xdigit:]){3}\-([:xdigit:]){12}' ConsoleWrite(StringRegExp($sUUID, $sRegExp) & @CRLF) Local $Result = StringRegExp($sUUID, $sRegExp) ConsoleWrite($Result & @CRLF) If @error Then ConsoleWrite('Error: [' & @error & ']' & @CRLF) Return 'False' Else ConsoleWrite('Error2: [' & @error & ']' & @CRLF) Return 'True' EndIf EndFunc In the line under the Function call, you'll see the regex I found to do this from a google search. That was my starting point, and I'm trying to get it to work in Au3 and failing miserably.
      $sTestF is a known invalid String
      $sTestT is a known valid String
      Everything I've tried so far has produced the same results for both.
      Any help you could provide me is greatly appreciated. Thanks for your time!