Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/366.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java中脚本标记模式的正则表达式模式 我叫约翰_Java_Regex - Fatal编程技术网

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
模式中
pass
DOTALL
flag
Pattern regex=Pattern.compile(“]*>(.*)”,Pattern.DOTALL)

或者可以在正则表达式中使用嵌入的标志表达式添加
DOTALL


(?s)]*>(.*)
在regex
模式中
pass
DOTALL
flag
Pattern regex=Pattern.compile(“]*>(.*)”,Pattern.DOTALL)

或者可以在正则表达式中使用嵌入的标志表达式添加
DOTALL


(?s)]*>(.*)

非常感谢您。。。它起作用了。。。。现在我觉得很愚蠢,这么小的事情没有在我的脑海中点击。非常感谢你。。。它起作用了。。。。现在我觉得自己很愚蠢,这么一件小事竟然没有在我的脑海中闪现。
<script>my name is john</script>