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

[Bug]: No runtime error for invalid character range in regex #39932

Closed
SasinduDilshara opened this issue Mar 21, 2023 · 1 comment · Fixed by #40003
Closed

[Bug]: No runtime error for invalid character range in regex #39932

SasinduDilshara opened this issue Mar 21, 2023 · 1 comment · Fixed by #40003
Labels
Lang/Regexp Issues related to Ballerina regular expressions Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Milestone

Comments

@SasinduDilshara
Copy link
Contributor

Description

Consider following code

import ballerina/lang.regexp;

public function main() returns error? {
    // regexp:RegExp _ = re `[z-a]`; // compile error: start char code is greater than end char code(BCE4035)
    regexp:RegExp _ = check regexp:fromString("[z-a]"); // no error
}

This should be a runtime error because z-a is a invalid range.

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Runtime

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@SasinduDilshara SasinduDilshara added Type/Bug Lang/Regexp Issues related to Ballerina regular expressions labels Mar 21, 2023
@ballerina-bot ballerina-bot added the Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime label Mar 21, 2023
@pcnfernando pcnfernando added Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. and removed Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime labels Mar 21, 2023
@github-actions
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

@LakshanWeerasinghe LakshanWeerasinghe added this to the 2201.6.0 milestone May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lang/Regexp Issues related to Ballerina regular expressions Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants