cfsimplicity / spreadsheet-cfml

Standalone library for working with spreadsheets and CSV in CFML
MIT License
126 stars 35 forks source link

Apparent compatibility issue in newDataValidation()/addDataValidation #347

Closed K-Diderot closed 9 months ago

K-Diderot commented 9 months ago

I'm in the middle of a large project so I'm unable to commit time for version testing or submitting a pull request but the RegEx expression in convertRangeReferenceToAbsoluteAddress throws an illegal group error.

The current method: string function convertRangeReferenceToAbsoluteAddress( required string rangeReference ){ return arguments.rangeReference.REReplace( "([A-Za-z]+|\d+)", "$\1", "ALL" ).UCase(); }

This is resolved by replacing the return string with: return arguments.rangeReference.REReplace("([A-Za-z]+|\\d+)", chr(36) & "1", "ALL").UCase(); At least this is how I resolved it.

ColdFusion | 2018,0,19,330149 Java VM Version | 11.0.21+9-LTS-193

If this might be a CF or JVM version issue please let me know.

cfsimplicity commented 9 months ago

Hi Kevin. I think the problem is that your app is using the Java regex engine instead of the default Perl one. This could be set in your Application.cfc as this.useJavaAsRegexEngine = true; or it could be set in your CF Administrator.

I'll try and come up with a fix so that it works with Java regex as well, but in the meantime try setting

this.useJavaAsRegexEngine = false;

in your Application.cfc.

cfsimplicity commented 9 months ago

I've added a fix for this on the develop branch. Please could you test it and report back? Thanks.