/** * 取出中括号内的内容 * @param text * @returns {string} */ export function getBracketStr(text) { let result = '' if (isObjEmpty(text)) return result let regex = /\[(.+?)\]/g; let options = text.match(regex) if (!isObjEmpty(options)) { let option = options[
import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexMatches { public static void main( String args[] ){ // 按指定模式在字符串查找 String line = "This order was placed for QT3000! OK?"; String pattern = "(\\D*)(\\d+)(.*)&q