Просмотр исходного кода

Missed template -> library rename

tags/v0.2.0
Garrick Aden-Buie 8 лет назад
Родитель
Сommit
0cc66bea8e
2 измененных файлов: 9 добавлений и 3 удалений
  1. +1
    -2
      R/regex_gadget.R
  2. +8
    -1
      inst/extdata/patterns.json

+ 1
- 2
R/regex_gadget.R Просмотреть файл

}) })


observeEvent(input$library_show, { observeEvent(input$library_show, {
browser()
showModal( showModal(
modalDialog( modalDialog(
title = "Regex Library", title = "Regex Library",
}) })


observeEvent(input$library_apply_pattern, { observeEvent(input$library_apply_pattern, {
updateTextInput(session, "pattern", value = this_template()$regex)
updateTextInput(session, "pattern", value = this_pattern()$regex)
updateSelectInput(session, "template", selected = "") updateSelectInput(session, "template", selected = "")
removeModal() removeModal()
}) })

+ 8
- 1
inst/extdata/patterns.json Просмотреть файл

"source":"https://projects.lukehaas.me/regexhub" "source":"https://projects.lukehaas.me/regexhub"
}, },
{ {
"name":"Web, URL",
"name":"Web, URL Simple",
"regex":"((https?|ftp|file)://)?([\\w\\d.-]+)\\.([a-zA-Z.]{2,6})([-/.a-zA-Z0-9]+)*/?", "regex":"((https?|ftp|file)://)?([\\w\\d.-]+)\\.([a-zA-Z.]{2,6})([-/.a-zA-Z0-9]+)*/?",
"description":"Match URL with optional protocol, e.g. <code>yahoo.com</code> or <code>https://yahoo.com/finance</code>. (Validation only, may have high false positives.)", "description":"Match URL with optional protocol, e.g. <code>yahoo.com</code> or <code>https://yahoo.com/finance</code>. (Validation only, may have high false positives.)",
"tags":"url,address,http", "tags":"url,address,http",
"source":"https://projects.lukehaas.me/regexhub" "source":"https://projects.lukehaas.me/regexhub"
}, },
{
"name":"Web, URL Extended",
"regex":"(?:(?:http(?:s)?|ftp)://)(?:\\S+(?::(?:\\S)*)?@)?(?:(?:[a-z0-9\u00a1-\uffff](?:-)*)*(?:[a-z0-9\u00a1-\uffff])+)(?:\\.(?:[a-z0-9\u00a1-\uffff](?:-)*)*(?:[a-z0-9\u00a1-\uffff])+)*(?:\\.(?:[a-z0-9\u00a1-\uffff]){2,})(?::(?:\\d){2,5})?(?:/(?:\\S)*)?",
"description":"More complicated URL validation that handles URLs such as <code>http://www.example.com/wpstyle/?p=364</code>, <code>http://foo.com/blah_blah_(wikipedia)_(again)</code>, or even <code>http://userid:password@example.com:8080/</code>.",
"tags":"url,address,http",
"source":"http://rpubs.com/jimhester/rex-url_parsing"
},
{ {
"name":"Network, IPv4 Address", "name":"Network, IPv4 Address",
"regex":"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", "regex":"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",

Загрузка…
Отмена
Сохранить