genius257 / stringregexpsplit Goto Github PK
View Code? Open in Web Editor NEWFunction for splitting a string by RegEx in AutoIt
License: MIT License
Function for splitting a string by RegEx in AutoIt
License: MIT License
StringRegExpSplit/StringRegExpSplit.au3
Line 44 in d4e816d
In AutoIt3, the Not operator has higher prescience than the equals sign, so Not $sValue == ""
is handled like (Not $sValue) == ""
instead of expected Not ($sValue == "")
please note that this is not true when using single equal.
Example code to reproduce problem:
StringRegExpSplit("resource(1) of type (Ptr)", "(.*\R)", 0, BitOR($PREG_SPLIT_DELIM_CAPTURE, $PREG_SPLIT_NO_EMPTY))
expected result:
["resource(1) of type (Ptr)"]
but in version v1.0.1 the result is:
[]
The code doesn't count the delimiters as part of the limit as seen with this code:
StringRegExpSplit("0,1,2,3,4,5,6,7,8,9", "(\|)", 2, $PREG_SPLIT_DELIM_CAPTURE)
StringRegExpSplit("0|1|2|3|4|5|6|7|8|9", "(\|)", 2, $PREG_SPLIT_DELIM_CAPTURE)
Expected: ["0", "|", "1|2|3|4|5|6|7|8|9"]
Actual: ["0", "|", "1", "|", "2|3|4|5|6|7|8|9"]
Edit: Forgot to escape pipe in delimiter and used wrong example
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.