表达式符号元素
您可以使用一组共享的表达式语法元素来配置口头表达式和自定义占位符。 这些元素根据结构、字符类型或格式模式,定义了字符串特定部分的匹配方式。
Use the elements below to configure verbal expressions and custom placeholders.
| Element | Aliases | Description | Usage examples |
|---|---|---|---|
start | startofline, start of line | mark expression with ^ | |
end | end of, endofline | mark the expression with $ | |
then | find | add a string to the expression | then "abc" |
maybe | define a string that might appear once or not | maybe "abc" | |
word | match any word that contains characters from a-z, A-Z, 0-9, including the _ (underscore) character | ||
anything | accept any string | ||
range | add a range to the expression | range "a,z,0,9" | |
something | accept any non-empty string | ||
anythingbut | anything but | accept any string but the specified character | anythingbut "abc" |
anyof | any, any of | any of the listed characters | anyof "abc" |
somethingbut | something but | anything non-empty except for these characters | somethingbut "abc" |
limit | add character limit | limit "1,3" | |
linebreak | line break, br | match \r \n (might be used only with other elements) | |
tab | match tabs \t (might be used only with other elements) | ||
multiple | adds the multiple modifier |
在编辑器中,您可以在高级筛选中使用语言表达式来搜索匹配特定模式的字符串,类似于正则表达式。 您可以使用它根据标点符号、字符类型、长度等模式筛选字符串。
例如,要查找所有以大写字母开头并以句点结尾的字符串,请使用以下表达式:
start "true", range "A,Z", anything, range "a,z,A,Z,0,9", limit "1,50", then ".", end "true"该表达式的含义为:
start "true"– 字符串从起始位置开始range "A,Z"– 以大写字母开头anything– 后跟任意字符range "a,z,A,Z,0,9"– 允许字母和数字limit "1,50"– 字符串长度在 1 到 50 个字符之间then "."– 以句点结尾end "true"– 字符串末尾
Verbal Tester 使用 Verbal Tester 应用程序在 Crowdin 项目中创建、检查和编辑口头表达式
试用口头表达式 GPT 协助在 Crowdin 中开发口头表达式。
以下是多个口头表达式示例,以及它们在项目中帮助匹配的字符串类型。 当您想要筛选具有特定内容或结构的字符串时,这些示例非常实用。
字符串示例:
A test string.表达式:
start "true", range "A,Z", anything, range "a,z,A,Z,0,9", limit "1,50", then ".", end "true"字符串示例:
Visit http://example.com or https://www.example.com表达式:
then "http", maybe "s", then "://", maybe "www.", anythingbut " "字符串示例:
Welcome, %s! You have %d new messages.表达式:
then "%", anyof "s,d"字符串示例:
Hello, {{user.name}}!表达式:
then "{{", range "a,z", multiple, then ".", range "a,z", multiple, then "}}"字符串示例:
Hello, {{User123.name42}}!表达式:
then "{{", range "a,z,A,Z,0,9", multiple, then ".", range "a,z,A,Z,0,9", multiple, then "}}"字符串示例:
The result is 3.14159表达式:
start, range "0,9", multiple, then ".", range "0,9", multiple, end字符串示例:
Quick Access is available now.表达式:
start, range "A,Z", range "a,z", multiple, then " ", range "A,Z", range "a,z", multiple字符串示例:
This is a sentence with trailing space表达式:
start "true", range "A,Z", anything, range "a,z,A,Z,0,9", then " ", end "true"字符串示例:
#GettingStarted表达式:
start "true", then "#", something, end "true"字符串示例:
Click <strong>here</strong> to continue.表达式:
then "<", something, then ">"字符串示例:
Please contact us at support@example.com表达式:
then "@", somethingbut " "字符串示例:
This string has extra space.表达式:
then " "字符串示例:
Enter your name:表达式:
then ":", end "true"字符串示例:
Total: $29.99表达式:
then "$", range "0,9", multiple字符串示例:
lowerUpper表达式:
start, range "a,z", multiple, range "A,Z", range "a,z", multiple, end 感谢您的反馈!