Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Regex Question

$
0
0
I have looked over this regex a bunch of times, but still can't figure out why it is doing this.

#include <Array.au3>
$sLine = "2+-13*3"
$aRegex = StringRegExp($sLine, "(?:-)(-[\d\.]+\*-?[\d\.]+)|(?:\+)(-[\d\.]+\*-?[\d\.]+)|[\d\.]+\*-?[\d\.]+", 1)
_ArrayDisplay($aRegex)


Will return two rows with the first row being blank, but if $sLine = "2-13*3" or $sLine = "2--13*3" it returns the single row. Why is that?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>