Я новичок в регулярных выражениях,
Кто-нибудь может объяснить мне шаблоны:
(<form[^\a]*</form>|<FORM[^\a]*</FORM>)
(method="[a-zA-Z]*|METHOD="[a-zA-Z]*)
От https://myregextester.com/index.php# (вводят шаблон в поле Match pattern
и удостоверяются, что Вы отсчитали Explain
. тогда нажмите , Отправляют ):
----------------------------------------------------------------------
( group and capture to \1:
----------------------------------------------------------------------
<form '<form'
----------------------------------------------------------------------
[^\a]* any character except: '\a' (alarm) (0 or
more times (matching the most amount
possible))
----------------------------------------------------------------------
</form> '</form>'
----------------------------------------------------------------------
| OR
----------------------------------------------------------------------
<FORM '<FORM'
----------------------------------------------------------------------
[^\a]* any character except: '\a' (alarm) (0 or
more times (matching the most amount
possible))
----------------------------------------------------------------------
</FORM> '</FORM>'
----------------------------------------------------------------------
) end of \1
----------------------------------------------------------------------
'\r\n'
----------------------------------------------------------------------
( group and capture to \2:
----------------------------------------------------------------------
method=" 'method="'
----------------------------------------------------------------------
[a-zA-Z]* any character of: 'a' to 'z', 'A' to 'Z'
(0 or more times (matching the most
amount possible))
----------------------------------------------------------------------
| OR
----------------------------------------------------------------------
METHOD=" 'METHOD="'
----------------------------------------------------------------------
[a-zA-Z]* any character of: 'a' to 'z', 'A' to 'Z'
(0 or more times (matching the most
amount possible))
----------------------------------------------------------------------
) end of \2
----------------------------------------------------------------------
'\r\n'
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
Два больших ресурса для RegExp: Debugexx и регулярные выражения 101
(<form[^\a]*</form>|<FORM[^\a]*</FORM>)
(method="[a-zA-Z]*|METHOD="[a-zA-Z]*)