I was just wondering if there was an "official" one out there.
Nothing "official".
$tx := '!^[\x20\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.
\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-
fA-F]{4}))*)")!'
but Active4D balked at character 126 saying a missing paren. I'm not
event going begin to try to understand that regexp!
Break it down:
! # opening delimiter
^ # anchor to start of string
[\x20\t\n\r]* # match zero or more whitespace characters (space, tab,
LF, CR)
(?: # start a non-capturing group of alternates
( # capture group 1
[,:\[\]{}]|true|false|null # match the characters ,:[]{}, "true",
"false", "null"
) # end capture group 1
| # OR
( # capture group 2
and so on. But the regexp syntax isn't the problem. The reason you are
getting the error is because you have to double all of the
backslashes, since they are inside a quoted string. In the original
javascript the regex pattern is not within a string, so single
backslashes are correct.
Once you double all of the backslashes the pattern works correctly.
Regards,
Aparajita
www.aparajitaworld.com
"If you dare to fail, you are bound to succeed."
- Sri Chinmoy | www.srichinmoy.org
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/