gpt4 book ai didi

java - [[ :jletterdigit:]] to classical regex

转载 作者:行者123 更新时间:2023-12-04 06:38:15 25 4
gpt4 key购买 nike

JFlex 中的 [[:jletterdigit:]] 中有哪些字符?
我需要将 [[:jletterdigit:]] 翻译成经典的正则表达式。

最佳答案

澄清迈克尔·洛曼的回答:
这是什么the JFlex documentation说:

jletter and jletterdigit are predefined character classes. jletter includes all characters for which the Java function Character.isJavaIdentifierStart returns true and jletterdigit all characters for that Character.isJavaIdentifierPart returns true.



他写的是 documentation of Character.isJavaIdentifierPart :

Determines if the specified character may be part of a Java identifier as other than the first character.

A character may be part of a Java identifier if any of the following are true:

it is a letter
it is a currency symbol (such as '$')
it is a connecting punctuation character (such as '_')
it is a digit
it is a numeric letter (such as a Roman numeral character)
it is a combining mark
it is a non-spacing mark
isIdentifierIgnorable returns true for the character


isIdentifierIgnorable 又被定义为:

Determines if the specified character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

The following Unicode characters are ignorable in a Java identifier or a Unicode identifier:

ISO control characters that are not whitespace
'\u0000' through '\u0008'
'\u000E' through '\u001B'
'\u007F' through '\u009F'
all characters that have the FORMAT general category value

关于java - [[ :jletterdigit:]] to classical regex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4605413/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com