Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular expression to limit the length of the parameter value #4695

Closed
Krusty84 opened this issue May 8, 2022 · 3 comments
Closed

Regular expression to limit the length of the parameter value #4695

Krusty84 opened this issue May 8, 2022 · 3 comments
Labels
need-customer-info Requires feedback from author

Comments

@Krusty84
Copy link

Krusty84 commented May 8, 2022

Hello Dear Team,
Could you help me please,
I want to set maximum length (63 symbols) for the specific parameter:

...

"FunctionName": {
      "type": "parameter",
      "datatype": "text",
      "isRequired": true,
      "defaultValue": "bla-bla-bla-bla",
    },

    "regName": {
      "type": "generated",
      "generator": "regex",
      "datatype": "text",
      "replaces": "dummyFunctionName",
      "parameters": {
        "source": "FunctionName",
        "action": "replace",
        "steps": [
          {
            "regex": "^.{1,63}",
            "replacement": ""
          }
        ]
      }
    }

But it doesn't work:(

Thank you for any idea!

@vlada-shubina vlada-shubina added the need-investigation The issue needs the second look and more investigation label May 10, 2022
@GangWang01
Copy link
Contributor

@Krusty84 I'm not sure what you want if the value of the parameter exceeds the maximum length. If you need to truncate the string after the maximum length, the regex can be (?<=.{63}).{0,} assuming the maximum length is 63.

@vlada-shubina vlada-shubina added need-customer-info Requires feedback from author and removed need-investigation The issue needs the second look and more investigation labels May 17, 2022
@vlada-shubina
Copy link
Member

Related: ability to validate parameter using regex: #2038

@Krusty84
Copy link
Author

Dears @GangWang01 and @vlada-shubina, thank you for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-customer-info Requires feedback from author
Projects
None yet
Development

No branches or pull requests

3 participants