-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
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 BlueBandana
Is there a way to output the regex matches into a file?
I have a script to compare two files and check for regex matches.
I want to output the matching regex of 'testexample.txt' to another file.
#include <MsgBoxConstants.au3> #include <Array.au3> $Read = FileReadToArray("C:\Users\admin\Documents\testexample.txt") $Dictionary = FileReadToArray("C:\Users\admin\Documents\example.txt") For $p = 0 To UBound($Dictionary) - 1 Step 1 $pattern = $Dictionary[$p] For $i = 0 To UBound($Read) - 1 Step 1 $regex = $Read[$i] If StringRegExp($regex, $pattern, 0) Then MsgBox(0, "ResultsPass", "The string is in the file, highlighted strings: " ) Else MsgBox(0, "ResultsFail", "The string isn't in the file.") EndIf Next Next
-
By guner7
Hello,
I need some help to parse the Green highlighted value with from below text:
RESISTOR THICK FILM 4.64K ±1% 1/4W ±100PPM/°C 1206 SMT
RESISTOR THICK FILM 3.83K ±1% 1/4W ±100PPM/°C 1206 SMT
RESISTOR CARBON FILM 22K ±10% 1/2W AXIAL THT
RESISTOR WIREWOUND 22 ±5% 3W ±30PPM/°C AXIAL THT
RESISTOR METAL OXIDE 4.7K ±5% 2 W ±300PPM/°C AXIAL THT
RESISTOR THICK FILM 0 1/8W 0805 SMT
I am using positive look behind.:
(?<=FILM|WOUND|OXIDE).+ Can only pull this off:
4.64K ±1% 1/4W ±100PPM/°C 1206 SMT 3.83K ±1% 1/4W ±100PPM/°C 1206 SMT 22K ±10% 1/2W AXIAL THT 22 ±5% 3W ±30PPM/°C AXIAL THT 4.7K ±5% 2 W ±300PPM/°C AXIAL THT 0 1/8W 0805 SMT I'm trying the \b word boundary to no avail at this point. Appreciate if anyone would guide me on this?
-
By junichironakashima
Im creating a code that will work in this sequence:
1. Copy the text (question) in one atea of the screen
2. Catch the 2 strings (number)
3. Multiply the 2 strings ( $1*$2)
4. Click the next area to put the answer
5. Paste the answer
This is my code
MouseClick($MOUSE_CLICK_LEFT, 479, 802, 3, 1) ;Clicking all of the text
Send("^c")
$x = StringRegExpReplace(ClipGet(), 'What is (\d*) x (\d*) \?$', "$1*$2")
MouseClick($MOUSE_CLICK_LEFT, 480, 844, 1, 1)
ClipPut($x)
Send("^v")
However the output is this
$1*$2
How can I make it solve itself? Because I tried this code:
MouseClick($MOUSE_CLICK_LEFT, 479, 802, 3, 1) ;Clicking all of the text
Send("^c")
MouseClick($MOUSE_CLICK_LEFT, 480, 844, 1, 1) $x = Execute(StringRegExpReplace(ClipGet(), 'What is (\d*) x (\d*) \?$', "$1*$2"))
ClipPut($x)
Send("^v")
Output is just blank text
-
By milkmoron
I am trying to search in a web browser dates XX/XX/XXXX that are also links. I want to click them after and remove them from the array. This is all I have so far. Nothing shows up. What am I doing wrong?
ControlFocus ("Customer Center", "", "")
Local $aArray = StringRegExp('(..)/(..)/(....)', '(..)/(..)/(....)', $STR_REGEXPARRAYFULLMATCH)
For $i = 0 To UBound($aArray) - 1
MsgBox($MB_SYSTEMMODAL, "RegExp Test with Option 2 - " & $i, $aArray[$i])
Next
-