You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is It Possible to Unify KCL and Python Regex Interfaces?
Is your feature request related to a problem? Please describe:
When working with regular expressions (regex), I've encountered a significant inconsistency between KCL and Python that has led to confusion and wasted time. This discrepancy exists in the way each language handles the regex.match function.
Yes, the issue you mentioned does exist. It was a consideration when designing the parameter order in the KCL regex package. Initially, we thought about keeping it consistent with Python, but in order to simplify the functionality, the function and parameter names in the entire regex package were not consistent with Python. KCL hopes to make a simpler Python like language instead of being compatible with it. In addition, not all languages have parameter order of (pattern, input), such as C# is also (input, pattern). Although adjusting the parameter order can be considered, it will break the existing module ecosystem and KCL code. 😢
Peefy
changed the title
Is It Possible to Unify KCL and Python Regex Interfaces?
[FAQ] Is It Possible to Unify KCL and Python Regex Interfaces?
Nov 5, 2024
Is It Possible to Unify KCL and Python Regex Interfaces?
Is your feature request related to a problem? Please describe:
When working with regular expressions (regex), I've encountered a significant inconsistency between KCL and Python that has led to confusion and wasted time. This discrepancy exists in the way each language handles the regex.match function.
In KCL regex match has interface:
while in python
Sources:
https://www.kcl-lang.io/docs/reference/model/regex#match
https://docs.python.org/3/library/re.html#re.match
Describe the feature you'd like:
Change an order of parameters of
regex.match
function in KCLThe text was updated successfully, but these errors were encountered: