' is required?

问题描述 投票:0回答:1

This is the string:

[randstr: sdfsdfds|dsfsdf sdfds 43rew|fds, 1-1]

This string may occurs in a text. This is my regexp I try:

`\[(randstr|randstrFixed):(\s+)?\|(.+)(\s+)?,(\s+)?[\d]+-[\d]+]`

The main goal to set to the pattern that: sdfsdfds|dsfsdf sdfds 43rew|fds - here may be any chars but at least one '[randstr: A-Z, 2-4]

- 这里是来自@Wiktor Stribiżew的文本和regexp示例。

在这里,你可以改变文字,现在的 "模式 "开始于 所以在regexp中我必须告诉它

必须发生。[-> [->

dsfsdf sdfds 43rew [randstr: sdfsdfds]
regex go
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.