将C#正则表达式转换为Java

将C#正则表达式转换为Java,c#,java,regex,C#,Java,Regex,C#中的这个正则表达式在java中给了我错误: "<input type="hidden" name="GALX" value="(?<galx>[a-zA-Z0-9_]+)">" “” 错误: Look-behind group does not have an obvious maximum length near index 60 <input type="hidden" name="GALX" value="(?<galx>[a-zA-Z

C#中的这个正则表达式在java中给了我错误:

"<input type="hidden" name="GALX" value="(?<galx>[a-zA-Z0-9_]+)">"  
“”
错误:

Look-behind group does not have an obvious maximum length near index 60
<input type="hidden" name="GALX" value="(?<galx>[a-zA-Z0-9_]+)">
Look-behind组在索引60附近没有明显的最大长度

Java中的等价表达式是什么?

我猜是这样的。我改为“逃过任何”

“”
编辑::对于“galx”的命名分组,只有java 7支持这一点


首先,您不应该使用正则表达式解析HTML,请参见此处:了解原因。第二,你犯了什么错误?第三,默认情况下,Java似乎会在正则表达式中添加“^”和“$”锚,因此您也必须考虑到这一点“。错误地改变了它here@UzairFarooq我相信这回答了你的问题,但是不…那不是答案,我仍然得到运行时间error@UzairFarooq就像我说的,你是否在使用Java1.7@AlanFoster是的,你是对的,我把它改成了这个,它工作得很好:“谢谢
"<input type=\"hidden\" name=\"GALX\" value=\"(?<galx>[a-zA-Z0-9_]+)\">"