Skip to content

Parsing error for some cases of named expressions with numbers (before: Named expression on format "HF2_2" not allowed) #1058

Closed

Description

@jboysen

But there is not information about why, and the naming doesn't violate the rules mentioned here: https://hyperformula.handsontable.com/guide/named-expressions.html#naming-convention

A jsfiddle to illustrate the issue: https://jsfiddle.net/uk1djxpw/1/

Activity

  1. sequba commented on Sep 7, 2022

    @sequba
    Contributor

    Hi, @jboysen. I am sorry you experienced an issue with HyperFormula. You are right, the naming rules for named expressions must be updated. Thank you for reporting it.

  2. self-assigned this
    on Sep 7, 2022
  3. added
    Docs
    Bug
    on Sep 7, 2022
  4. jboysen commented on Sep 7, 2022

    @jboysen
    Author

    The implementation of isNameValid indicates that the name is valid:

    public isNameValid(expressionName: string): boolean {
    if (/^[A-Za-z]+[0-9]+$/.test(expressionName)) {
    return false
    }
    return /^[A-Za-z\u00C0-\u02AF_][A-Za-z0-9\u00C0-\u02AF._]*$/.test(expressionName)
    }

    Is the implementation incorrect?

  5. sequba commented on Sep 8, 2022

    @sequba
    Contributor

    It might be incorrect or there is something else going on here. Our team will investigate this issue shortly.

  6. changed the title [-]Named expression on format "HF2_2" not allowed[/-] [+]Parsing error when named expression contains numbers (before: Named expression on format "HF2_2" not allowed)[/+] on Nov 9, 2022
  7. sequba commented on Nov 9, 2022

    @sequba
    Contributor

    Also, the heading Naming convention in our named expressions guide is very misleading. What this section describes is not a convention. These are the requirements for a valid name of the expression. @kirszenbaum proposed to change the heading to Custom name rules.

  8. AMBudnik commented on Nov 9, 2022

    @AMBudnik
    Contributor
  9. jboysen commented on Nov 9, 2022

    @jboysen
    Author

    I see now the title changed of this issue. We looked more into this, and found that "HF2_2" is problematic, but "HF_2" was not, so the title is now misleading.

    For now we solved it by checking our named expressions like this in a validate method:

    if (/^[A-Z]+\d+/ig.test(variable)) {
        return false;
    }
    
  10. changed the title [-]Parsing error when named expression contains numbers (before: Named expression on format "HF2_2" not allowed)[/-] [+]Parsing error for some cases of named expressions with numbers (before: Named expression on format "HF2_2" not allowed)[/+] on Nov 9, 2022
  11. sequba commented on Nov 9, 2022

    @sequba
    Contributor

    @jboysen Thank you for your input. It will come in handy in the process of working on this issue.

  12. sequba commented on Nov 10, 2022

    @sequba
    Contributor

    Possible duplicate: #880

  13. sequba commented on Mar 3, 2023

    @sequba
    Contributor

    @jboysen,

    I'm more than happy to announce that we just released HyperFormula 2.3.1 where this issue is fixed. We are closing this issue as solved. If there is anything that won't work for you after updating, please leave a comment.

  14. kevinplummer commented on Mar 14, 2023

    @kevinplummer

    Because HF can handle more columns than Excel something like AUFRINGES1 named range expression is invalid in HF but not Excel. How about if we set MaxColumns to say 26 or max Excel columns could you only do the named range check up to that column for compatibility?

  15. AMBudnik commented on Mar 14, 2023

    @AMBudnik
    Contributor

    Hi @kevinplummer that's an interesting idea. But at the moment, it is not available out of the box. If you'd like to test a custom solution and create a pull request we would be more than happy to review it as at the moment we focus more on fixing issues than on providing new functionalities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugDocsImpact: High

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions