5 posts in this topic
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:
1: 'a b c'
but it gives me:
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:
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.
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
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
13:52~SUN, MON, TUE, WED, THU, FRI, SAT|String
02:52 XX~SUN, MON, FRI|String
22/04/2017 02:52 YY|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, TUE, WED
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.
This is a program that I made to help my self learn better regular expressions.
There are a lot of other programs/website with the similar functions.
But the main advantage of this program is that you don't have to click a button after every changes.
The program detected changes and react on it.
- Match - Match of arrays - Match and replace - Load source data from website - Load source data from a website with POST - Load text data from file - Clear fields - Export and Import settings (you can finish the expression a other time, just export/import it) - Cheat sheet The source code is not difficult and I think most user will understand it.
This program does need the winhttp udf https://www.autoitscript.com/forum/topic/84133-winhttp-functions/ (it's also include in the zip file)
In the zip file there is also a export file (POST example), this is a example of website source code with POST.
You can download it here Regex toolkit.zip
EDIT: Updated to version V1.2.0
- expand and collapse of the cheat sheet (Thanks to Melba23 for the Guiextender UDF) - usefull regular expressions websites links included in the prgram - text data update time