如何在 JSF 中编写以下 JS 正则表达式

问题描述

<h:outputText value=""/>
<h:panelGroup>
<h:outputText value="State &amp; City Geolocation URL "/>
<h:inputText id="URL" value="#{geolocationBean.geolocationURL}" required="true">
<f:validator validatorId="urlValidator"/>
    <f:validateRegex pattern="(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?" />
</h:inputText>
<h:message style="color:red" for="URL"/>
</h:panelGroup>

我有 Url 验证器正则表达式是 "(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?" 以下内容在 JavaScript 中有效,但在 JSF 中无效

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)