简体   繁体   English

从Java中的字符串$ {VALUE(word_to_be_extracted)}中提取单词的正则表达式

[英]Regular expression to extract the word from the string ${VALUE(word_to_be_extracted)} in java

What is the best regex to extract the word inside that string? 提取字符串中单词的最佳正则表达式是什么?

Pattern pattern = Pattern.compile("pattern here");
                    Matcher matcher = pattern.matcher(${VALUE(word_to_be_extracted)});

                    while(matcher.find()) {
                        System.out.println(matcher.group());

                    }

/\\$\\{VALUE\\((.*)\\)\\}/

第一个捕获组将成为您的承诺

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM