Java中脚本标记模式的正则表达式模式 我叫约翰
我想要这个模式的正则表达式。我做了正则表达式Java中脚本标记模式的正则表达式模式 我叫约翰,java,regex,Java,Regex,我想要这个模式的正则表达式。我做了正则表达式 <script> my name is john </script> ]*>(**?) 它检测的模式如下: <script[^>]*>(.*?)</script> 我叫约翰 但是没有检测到第一个,这是我所要求的。可能是因为'newline'。在regex模式中passDOTALLflag Pattern regex=Pattern.compile(“]*>(.*)”,Pattern.DO
<script>
my name is john
</script>
]*>(**?)
它检测的模式如下:
<script[^>]*>(.*?)</script>
我叫约翰
但是没有检测到第一个,这是我所要求的。可能是因为'newline'。在regex
模式中
passDOTALL
flagPattern regex=Pattern.compile(“]*>(.*)”,Pattern.DOTALL)代码>
或者可以在正则表达式中使用嵌入的标志表达式添加DOTALL
(?s)]*>(.*)
在regex模式中
passDOTALL
flag
Pattern regex=Pattern.compile(“]*>(.*)”,Pattern.DOTALL)代码>
或者可以在正则表达式中使用嵌入的标志表达式添加DOTALL
(?s)]*>(.*)
非常感谢您。。。它起作用了。。。。现在我觉得很愚蠢,这么小的事情没有在我的脑海中点击。非常感谢你。。。它起作用了。。。。现在我觉得自己很愚蠢,这么一件小事竟然没有在我的脑海中闪现。
<script>my name is john</script>