Something happened between 5.3.8.3 and 5.3.8.42 to...
# lucee
a
Something happened between 5.3.8.3 and 5.3.8.42 to break
reMatch
. Probably something to do with one of these two: https://luceeserver.atlassian.net/issues/?jql=fixversion%20%20%3E%3D%205.3.8.4%20and%20fixversion%20%3C%3D%205.3.8.42%20and%20text%20~%20regex Repro:
Copy code
s = ""
pattern = ".*"
writeDump([
    reMatch = s.reMatchNoCase(pattern),
    matches = s.matches(pattern),
    split = s.split(pattern)
])
https://trycf.com/gist/5761040d136d2c4396d89bb60e97043f/lucee5?theme=monokai Compare the difference between Lucee 5 (
reMatch
returns an empty array) and Lucee 4.5 and CF2021 (correctly returns an array with one empty string in it). One might try to reason out of this, saying it's the difference between
this.useJavaAsRegexEngine = true
and
this.useJavaAsRegexEngine = false
. Whilst setting it to
true
does "fix" the issue, that's neither here nor there, because with either Java or PCRE (or... Apache ORO I think, but that's close to a very old version of PRCE I think anyhow?) regexes, the results should be the same:
.*
matches an empty string. Also note changing that setting on CF2021 has no effect: it returns
[""]
either way. Which is correct. This breaks TestBox, for a specific edge-case (which I have raised separately in the testing channel).
Sigh. CFWheels needs
this.useJavaAsRegexEngine = false
So TestBox needs it one way. CFWheels needs it the other way. Do ppl recall how I've always said these stupid flags to change behaviour of the language were a fuckin dumb idea, and are basically unusable in a day and age where we all rely on third-party libs to do our jobs? Exhibit. Fucking. A.
☝🏻 2