我试图用REGEX识别bbcodes内部文本。 我有以下文字: Lorem ipsum dolor sit amet, [color] consectetur adipisicing el it labore et [color=red]dolore magna aliqua[/color] minim veniam.
而且我目前使用这种模式: /\[([a-z0-9]+).+?\[\/\1\
我想使用1到8个字符之间的正则表达式提取文本,不包含2个以上的字母([A-Za-z])。 例如: Valid: "12A-32B" from the text "Register:12A-32B Index:A"
Invalid: "12 Index" from the text "Register:12 Index:A"
在这个例子中,所提取的文本应该有文字“注册”为界。 我试过使用积极/