Jump to content
Sign in to follow this  
OverloadUT

StringRegExp result not making any sense

Recommended Posts

OverloadUT

Okay, I've been banging my head against this for at least an hour now.

I'm sure it's something simple, but I can't for the life of me figure it out. I wanted to check here before I submit it as a bug.

$data = "|pbupload:test|anothervar:test2|"
$regex = StringRegExp($data, "|error:([^|:]+)|", 1)
ConsoleWrite(@error&@CRLF&@extended&@CRLF)

That outputs:

0
1

WHY? The pattern should mean:

Literal string "|error:" followed by 1 or more characters that are not "|" or ":" (and capture it as a group) and then the literal string "|"

That pattern should NOT match the test string because "error:" is not in it!

Please tell me I'm going crazy and missing something simple...

Edited by OverloadUT

Share this post


Link to post
Share on other sites
OverloadUT

...

I knew it was something simple. And I've been using regular expressions for years too. I am ashamed. :D

Thanks!

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
Sign in to follow this  

×