символ шаблона в обычном выражение [закрыто]

Я новичок в регулярных выражениях,

Кто-нибудь может объяснить мне шаблоны:

(<form[^\a]*</form>|<FORM[^\a]*</FORM>)
(method="[a-zA-Z]*|METHOD="[a-zA-Z]*)
2
задан 20 November 2015 в 17:13

2 ответа

От 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
----------------------------------------------------------------------
0
ответ дан 2 December 2019 в 05:00

Два больших ресурса для RegExp: Debugexx и регулярные выражения 101

(<form[^\a]*</form>|<FORM[^\a]*</FORM>)

Regular expression visualization

Debuggex

enter image description here

регулярные выражения 101


(method="[a-zA-Z]*|METHOD="[a-zA-Z]*)

Regular expression visualization

Debuggex

enter image description here

регулярные выражения 101

1
ответ дан 2 December 2019 в 05:00

Другие вопросы по тегам:

Похожие вопросы: