🔍 An RStudio addin slash regex utility belt
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

438 lines
19KB

  1. [{
  2. "name":"Date/Time, Date DD/MM/YYY",
  3. "regex":"(0?[1-9]|[12][0-9]|3[01])([ /-])(0?[1-9]|1[012])\\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):[0-5]?[0-9])?",
  4. "description":"Will match dates with dashes, slashes or with spaces (e.g. <code>dd-mm-yyyy</code> <code>dd/mm/yyyy</code> <code>dd mm yyyy</code>), and optional time separated by a space or a dash (e.g. <code>dd-mm-yyyy-hh:mm:ss</code> or <code>dd/mm/yyyy hh:mm:ss</code>).",
  5. "tags":"date,time",
  6. "source":"https://projects.lukehaas.me/regexhub"
  7. },
  8. {
  9. "name":"Date/Time, Date MM/DD/YYYY",
  10. "regex":"(0?[1-9]|1[012])([ /-])(0?[1-9]|[12][0-9]|3[01])\\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):([0-5]?[0-9])(?::([0-5]?[0-9])))?",
  11. "description":"Will match dates with dashes, slashes or with spaces (e.g. <code>mm-dd-yyyy</code> <code>mm/dd/yyyy</code> <code>mm dd yyyy</code>), and optional time separated by a space or a dash (e.g. <code>mm-dd-yyyy-hh:mm:ss</code> or <code>mm/dd/yyyy hh:mm:ss</code>).",
  12. "tags":"date,time"
  13. },
  14. {
  15. "name":"Date/Time, Time in 24-hour format",
  16. "regex":"([01]?[0-9]|2[0-3]):([0-5][0-9]):?([0-5][0-9])?",
  17. "description": "Match times in 24 hour format.",
  18. "tags":"date,time",
  19. "source":"https://projects.lukehaas.me/regexhub"
  20. },
  21. {
  22. "name":"Date/Time, Time ISO-8601",
  23. "regex":"(?![+-]?\\d{4,5}-?(?:\\d{2}|W\\d{2})T)(?:|(\\d{4}|[+-]\\d{5})-?(?:|(0\\d|1[0-2])(?:|-?([0-2]\\d|3[0-1]))|([0-2]\\d{2}|3[0-5]\\d|36[0-6])|W([0-4]\\d|5[0-3])(?:|-?([1-7])))(?:(?!\\d)|T(?=\\d)))(?:|([01]\\d|2[0-4])(?:|:?([0-5]\\d)(?:|:?([0-5]\\d)(?:|\\.(\\d{3})))(?:|[zZ]|([+-](?:[01]\\d|2[0-4]))(?:|:?([0-5]\\d)))))",
  24. "description": "Will match a valid date and times in the <a href=\"https://www.iso.org/iso-8601-date-and-time-format.html\">ISO-8601 format</a>, excludes durations. Requires Perl.",
  25. "tags": "date,time",
  26. "source":"https://projects.lukehaas.me/regexhub"
  27. },
  28. {
  29. "name":"Web, HTML tags",
  30. "regex":"<([a-z1-6]+)([^<]+)*(?:>(.*)</\\1>| */>)",
  31. "description":"Match opening and closing HTML tags with content between.",
  32. "tags":"markup,xml,html",
  33. "source":"https://projects.lukehaas.me/regexhub"
  34. },
  35. {
  36. "name":"Web, Username",
  37. "regex":"[a-zA-Z0-9_-]{3,16}",
  38. "description":"A string between 3 and 16 characters, allowing alphanumeric characters and hyphens and underscores.",
  39. "tags":"username,validation",
  40. "source":"https://projects.lukehaas.me/regexhub"
  41. },
  42. {
  43. "name":"Hex Color Value",
  44. "regex":"#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})\\b",
  45. "description":"Detect RGB hex colors.",
  46. "tags":"hex,color",
  47. "source":"https://projects.lukehaas.me/regexhub"
  48. },
  49. {
  50. "name":"Web, URL Slug",
  51. "regex":"[[:alnum:]-]+",
  52. "description":"Match valid URL slugs.",
  53. "tags":"URL",
  54. "source":"https://projects.lukehaas.me/regexhub"
  55. },
  56. {
  57. "name":"Web, Email",
  58. "regex":"([[:alnum:]_.-]+)@([[:alnum:].-]+)\\.([[:alpha:].]{2,6})",
  59. "description":"Simple (but imperfect) email validation.",
  60. "tags":"email,validation"
  61. },
  62. {
  63. "name":"Web, Image Source Path",
  64. "regex":"<\\s*img[^>]+src\\s*=\\s*([\"'])(.*?)\\1[^>]*>",
  65. "description":"Match the src attribute of an HTML image tag.",
  66. "tags":"html,tag,image",
  67. "source":"https://projects.lukehaas.me/regexhub"
  68. },
  69. {
  70. "name":"Web, URL Simple",
  71. "regex":"((https?|ftp|file)://)?([\\w\\d.-]+)\\.([a-zA-Z.]{2,6})([-/.a-zA-Z0-9]+)*/?",
  72. "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.)",
  73. "tags":"url,address,http",
  74. "source":"https://projects.lukehaas.me/regexhub"
  75. },
  76. {
  77. "name":"Web, URL Extended",
  78. "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)*)?",
  79. "description":"More complicated URL validation that handles fully-qualified 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>.",
  80. "tags":"url,address,http",
  81. "source":"http://rpubs.com/jimhester/rex-url_parsing"
  82. },
  83. {
  84. "name":"Network, IPv4 Address",
  85. "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]?)",
  86. "description":"Match IP v4 addresses, e.g. <code>98.139.180.149</code>.",
  87. "tags":"tcpip,internet,address",
  88. "source":"https://projects.lukehaas.me/regexhub"
  89. },
  90. {
  91. "name":"Network, IPv6 Address",
  92. "regex":"(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))",
  93. "description": "Match IP v6 addresses, e.g. <code>2002:4559:1FE2::4559:1FE2</code>.",
  94. "tags":"tcpip,internet,address"
  95. },
  96. {
  97. "name":"Web, JSON Web Token",
  98. "regex":"[A-Za-z0-9-_=]+\\.[A-Za-z0-9-_=]+\\.?[A-Za-z0-9-_.+/=]*",
  99. "description": "JSON Web Token (encoded).",
  100. "tags":"www",
  101. "source":"https://projects.lukehaas.me/regexhub"
  102. },
  103. {
  104. "name":"Number, Positive Integer",
  105. "regex":"\\d+",
  106. "description":"Match whole numbers above zero.",
  107. "tags":"number",
  108. "source":"https://projects.lukehaas.me/regexhub"
  109. },
  110. {
  111. "name":"Number, Negative Integer",
  112. "regex":"-\\d+",
  113. "description":"Match whole numbers below zero.",
  114. "tags":"number",
  115. "source":"https://projects.lukehaas.me/regexhub"
  116. },
  117. {
  118. "name":"Number, Integer",
  119. "regex":"-?\\d+",
  120. "description":"Match whole numbers, above or below zero.",
  121. "tags":"number",
  122. "source":"https://projects.lukehaas.me/regexhub"
  123. },
  124. {
  125. "name":"Number, Positive (integer or float)",
  126. "regex":"\\d*\\.?\\d+",
  127. "description":"Match integers or floats that are positive.",
  128. "tags":"float",
  129. "source":"https://projects.lukehaas.me/regexhub"
  130. },
  131. {
  132. "name":"Number, Negative (integer or float)",
  133. "regex":"-\\d*\\.?\\d+",
  134. "description":"Match integers or floats that are negative.",
  135. "tags":"float",
  136. "source":"https://projects.lukehaas.me/regexhub"
  137. },
  138. {
  139. "name":"Number, Integer or Float",
  140. "regex":"-?\\d*\\.?\\d+",
  141. "description":"Match integers or floats that are positive or negative.",
  142. "tags":"float",
  143. "source":"https://projects.lukehaas.me/regexhub"
  144. },
  145. {
  146. "name":"Phone Number, General",
  147. "regex":"\\+?(\\d.*){3,}",
  148. "description":"Match phone numbers at least 3 digits long.",
  149. "tags":"validation",
  150. "source":"https://projects.lukehaas.me/regexhub"
  151. },
  152. {
  153. "name":"Phone Number, US",
  154. "regex":"(?:1)?[ .-]?(?:\\(?([2-9][0-9]{2})\\)?[ .-]?)?(?:(([2-9][0-9]{2})[ .-]?([0-9]{4}))|([0-9]{3}[ .-]?[0-9]{4}))",
  155. "description":"Match US phone number, with or without country or area code. Matches phone numbers like <code>1-800-234-5678</code> or <code>234-5679</code> or <code>(555) 432-1234</code>.",
  156. "tags":"validation"
  157. },
  158. {
  159. "name":"Web, Youtube ID from Video URL",
  160. "regex":"https?://(?:youtu\\.be/|(?:[a-z]{2,3}\\.)?youtube\\.com/watch(?:\\?|#!)v=)([[:alnum:]-]{11}).*",
  161. "description":"Match the ID of a youtube video URL.",
  162. "tags":"video,youtube,url",
  163. "source":"https://projects.lukehaas.me/regexhub"
  164. },
  165. {
  166. "name":"Web, Youtube ID of Channel from URL",
  167. "regex":"https?://(www\\.)?youtube.com/channel/UC([-_a-z0-9]{22})/i",
  168. "description":"Match the ID of a youtube channel URL.",
  169. "tags":"channel,youtube,url",
  170. "source":"https://projects.lukehaas.me/regexhub"
  171. },
  172. {
  173. "name":"Web, CSS comment",
  174. "regex":"/\\*[^*]*\\*+([^/*][^*]*\\*+)*/",
  175. "description":"Match standard CSS comments.",
  176. "tags":"css,comment,code",
  177. "source":"https://projects.lukehaas.me/regexhub"
  178. },
  179. {
  180. "name":"Web, Wordpress shortcodes",
  181. "regex":"\\[([a-z-_0-9]+)([^\\[]+)*(?:\\](.*)\\[/\\1\\]|\\s+/\\])",
  182. "description":"Matches opening and closing shortcode tags with content in-between them.",
  183. "tags":"wordpress,shortcodes,markup",
  184. "source":"https://projects.lukehaas.me/regexhub"
  185. },
  186. {
  187. "name":"Postal, U.S./Canadian ZIP/Postal Code",
  188. "regex":"(^\\d{5}(-\\d{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}\\d{1}[A-Z]{1} *\\d{1}[A-Z]{1}\\d{1}$)",
  189. "description":"Matches US ZIP, ZIP+4, and Canadian Postal Codes.",
  190. "tags":"address, postal, zip",
  191. "source":"https://projects.lukehaas.me/regexhub"
  192. },
  193. {
  194. "name":"Postal, UK Postal Code",
  195. "regex":"(([gG][iI][rR] {0,}0[aA]{2})|(([aA][sS][cC][nN]|[sS][tT][hH][lL]|[tT][dD][cC][uU]|[bB][bB][nN][dD]|[bB][iI][qQ][qQ]|[fF][iI][qQ][qQ]|[pP][cC][rR][nN]|[sS][iI][qQ][qQ]|[iT][kK][cC][aA]) {0,}1[zZ]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yxA-HK-XY]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y]))) {0,}[0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}))",
  196. "description":"Matches all UK postcodes.",
  197. "tags":"address, postal, zip",
  198. "source":"https://projects.lukehaas.me/regexhub"
  199. },
  200. {
  201. "name":"Postal, Brazilian ZIP/Postal Code",
  202. "regex":"[0-9]{5}-[0-9]{3}",
  203. "description":"Matches BR ZIP/Postal Code.",
  204. "tags":"address, postal, zip",
  205. "source":"https://projects.lukehaas.me/regexhub"
  206. },
  207. {
  208. "name":"Morse Code",
  209. "regex":"[.-]{1,5}(?:[ \\t]+[.-]{1,5})*(?:[ \\t]+[.-]{1,5}(?:[ \\t]+[.-]{1,5})*)*",
  210. "description":"Matches valid Morse Code.",
  211. "tags":"morse, code",
  212. "source":"https://projects.lukehaas.me/regexhub"
  213. },
  214. {
  215. "name":"LaTeX Citation",
  216. "regex":"\\\\[a-zA-Z0-9]{0,}cite[a-zA-Z0-9]{0,}(\\[([^]]+)\\]){0,2}\\**\\{([a-zA-Z0-9 ,]+)\\}",
  217. "description":"Matches LaTeX citation commands, such as <code>\\cite{Moe1999}</code> and <code>\\authorcite{Curly2000}</code>",
  218. "tags":"latex, text",
  219. "source":"https://github.com/trinker/qdapRegex/"
  220. },
  221. {
  222. "name":"Postal, US City and State",
  223. "regex":"([A-Z][\\w-]*(\\s+[A-Z][\\w-]*)+),\\s*([A-Z]{2})\\b|(\\b[A-Za-z]+),\\s*([A-Z]{2})\\b",
  224. "description":"Detects city comma state, e.g. <code>Anchorage, AK</code> or <code>New York City, NY</code>",
  225. "tags":"address, postal, zip, city, state",
  226. "source":"https://github.com/trinker/qdapRegex/"
  227. },
  228. {
  229. "name":"Postal, US City, State and Zip",
  230. "regex":"([A-Z][\\w-]*(\\s+[A-Z][\\w-]*)+),\\s*([A-Z]{2})\\s*(?<!\\d)\\d{5}(?:[ -]\\d{4})?\\b|(\\b[A-Za-z]+),\\s*([A-Z]{2})\\s*(?<!\\d)\\d{5}(?:[ -]\\d{4})?\\b",
  231. "description":"Detects (single lower case word or multiple consecutive capitalized words before a comma and state) + state (2 consecutive capital letters) + zip code (5 digits or 5 + 4 digits) from a string.",
  232. "tags":"address, postal, zip, city, state",
  233. "source":"https://github.com/trinker/qdapRegex/"
  234. },
  235. {
  236. "name":"Date/Time, Date Numeric",
  237. "regex":"\\d{0,2}/\\d{2}/(?:\\d{4}|\\d{2})?|\\d{0,2}-\\d{2}-(?:\\d{4}|\\d{2})?|\\d{0,2}\\.\\d{2}\\.(?:\\d{4}|\\d{2})?",
  238. "description":"Detects dates of the form <code>XX/XX/XXXX</code>, <code>XX/XX/XX</code>, <code>XX-XX-XXXX</code>, <code>XX-XX-XX</code>, <code>XX.XX.XXXX</code>, or <code>XX.XX.XX</code>.",
  239. "tags":"",
  240. "source":"https://github.com/trinker/qdapRegex/"
  241. },
  242. {
  243. "name":"Date/Time, Date Longform with Month",
  244. "regex":"(\\b)([A-Za-z]{3,9})(\\s+)([0-9][0-9]*)(,)(\\s+)([0-9]{4})",
  245. "description":"Detects dates of the form <code>March XX, XXXX</code> or <code>Mar XX, XXXX</code>",
  246. "tags":"",
  247. "source":"https://github.com/trinker/qdapRegex/"
  248. },
  249. {
  250. "name":"Date/Time, Date YYYY-MM-DD",
  251. "regex":"[0-9]{4}[.-][0-9]{2}[.-][0-9]{2}",
  252. "description":"Detects numeric European-style dates: <code>YYYY-MM-DD</code>",
  253. "tags":"",
  254. "source":"https://github.com/trinker/qdapRegex/"
  255. },
  256. {
  257. "name":"Date/Time, Date General",
  258. "regex":"\\d{0,2}/\\d{2}/(?:\\d{4}|\\d{2})?|\\d{0,2}-\\d{2}-(?:\\d{4}|\\d{2})?|\\d{0,2}\\.\\d{2}\\.(?:\\d{4}|\\d{2})?|(\\b)([A-Za-z]{3,9})(\\s+)([0-9][0-9]*)(,)(\\s+)([0-9]{4})|[0-9]{4}-[0-9]{2}-[0-9]{2}",
  259. "description":"Detects numeric dates or dates with text month, e.g. <code>XX/XX/XXXX</code>, etc., or <code>Mar XX, XXXX</code>, etc., or <code>XXXX-XX-XX</code>",
  260. "tags":"",
  261. "source":"https://github.com/trinker/qdapRegex/"
  262. },
  263. {
  264. "name":"Web, Email 2",
  265. "regex":"([_+a-z0-9-]+(\\.[_+a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,14}))",
  266. "description":"General (not perfect) detection of email adressess such as <code>foo@google.com</code>. Will also detect other valid email addressess like <code>foo+bar@google.com</code>.",
  267. "tags":"",
  268. "source":"http://stackoverflow.com/a/25077704/1000343"
  269. },
  270. {
  271. "name":"Web, Emoticon",
  272. "regex":">?[:;=8XB]{1}[-~+o^]?[|\")(&gt;DO>{pP3/]+|</?3|XD+|D:<|x[-~+o^]?[|\")(&gt;DO>{pP3/]+",
  273. "description":"Captures common text emoticons, like <code>:-P</code>",
  274. "tags":"",
  275. "source":"https://github.com/trinker/qdapRegex/"
  276. },
  277. {
  278. "name":"Number, General",
  279. "regex":"(?<=^| )[-.]*\\d+(?:\\.\\d+)?(?= |\\.?$)|\\d+(?:,\\d{3})+(\\.\\d+)*",
  280. "description":"Detect numbers in a string (works on numbers with commas, decimals and negatives)",
  281. "tags":"",
  282. "source":"https://github.com/trinker/qdapRegex/"
  283. },
  284. {
  285. "name":"Number, Percentage",
  286. "regex":"\\(?[0-9.]+\\)?%",
  287. "description":"Detects percentages in a string",
  288. "tags":"",
  289. "source":"https://github.com/trinker/qdapRegex/"
  290. },{
  291. "name":"Phone Number, US Extended",
  292. "regex":"(?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:\\(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*\\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})(?:\\s*(?:#|x\\.?|ext\\.?|extension)\\s*(\\d+))?",
  293. "description":"General phone number that just \"look for a string of at least 5 characters made up entirely of digits, periods, brackets, hyphens or spaces\"",
  294. "tags":"",
  295. "source":"http://stackoverflow.com/a/21008254/1000343"
  296. },
  297. {
  298. "name":"Text, Repeated Characters",
  299. "regex":"\\b(\\S+?)\\1\\S*\\b",
  300. "description":"Detect words with repeating characters. The word must contain characters, each repeating at east 2 times.",
  301. "tags":"",
  302. "source":"http://stackoverflow.com/a/29438461/1000343"
  303. },
  304. {
  305. "name":"Text, Repeated Phrases",
  306. "regex":"(?i)\\b(\\w.*)((?:\\s|\\.{3}|,)+\\1)+\\b",
  307. "description":"Detect repeating phrases in a string.",
  308. "tags":"",
  309. "source":"http://stackoverflow.com/a/28786617/1000343"
  310. },
  311. {
  312. "name":"Text, Repeated Words",
  313. "regex":"(?i)\\b(\\w+)\\s+\\1\\b",
  314. "description":"Detect repeating words in a string.",
  315. "tags":"",
  316. "source":"https://github.com/trinker/qdapRegex/"
  317. },
  318. {
  319. "name":"Text, Title Name",
  320. "regex":"(((Dr|Mr|Mrs|Ms|dr|mr|mrs|ms)(\\.))|(Miss|Mizz|mizz))(\\s+)([A-Za-z]+)(\\s[A-Z][A-Za-z]*\\b)*",
  321. "description":"Detect title (honorific) + person name(s) from a string.",
  322. "tags":"",
  323. "source":"https://github.com/trinker/qdapRegex/"
  324. },
  325. {
  326. "name":"Date/Time, Time General",
  327. "regex":"\\d{0,2}:\\d{2}(?:[:.]\\d+)?",
  328. "description":"Detects time formats like <code>HH:MM</code>, <code>HH:MM:SS</code>, or <code>MM:SS.dddd</code>.",
  329. "tags":"",
  330. "source":"https://github.com/trinker/qdapRegex/"
  331. },
  332. {
  333. "name":"Date/Time, Time with AM/PM",
  334. "regex":"(\\d{0,2}:\\d{2}(?:[:.]\\d+)?)(\\s+(([AP]\\.{0,1}M\\.{0,1})|([ap]\\.{0,1}m\\.{0,1})))",
  335. "description":"Detects time formats that optionally include AM/PM indicators.",
  336. "tags":"",
  337. "source":"https://github.com/trinker/qdapRegex/"
  338. },
  339. {
  340. "name":"Date/Time, Timestamp",
  341. "regex":"(#)?([0-9]){1,2}:?([0-9]){1,2}[:.]([0-9]){2}([:,.-][0-9]+)?#??|\\d{1}:\\d{2}",
  342. "description":"Detects full timestamps formatted like <code>HH:MM:SS.OS</code>",
  343. "tags":"",
  344. "source":"https://github.com/trinker/qdapRegex/"
  345. },
  346. {
  347. "name":"Web, Twitter URL",
  348. "regex":"(https?://t\\.co[^ ]*)|(t\\.co[^ ]*)",
  349. "description":"Detects Twitter Short URLs.",
  350. "tags":"",
  351. "source":"https://github.com/trinker/qdapRegex/"
  352. },
  353. {
  354. "name":"Text, Whitespace Anywhere",
  355. "regex":"^\\s+|\\s+$|\\s+(?=[.](?:\\D|$))|(\\s+)(?=[,]|[;:?!\\]\\}\\)]+)|(?<=[\\(\\[\\{])(\\s+)|(\\s+)(?=[\\s])",
  356. "description":"Detects multiple white space, white space before a comma, white space before a single or consecutive combination of a colon, semicolon, or endmark (period, question mark, or exclamation point), white space after a left bracket (\"\", \"(\", \"[\") or before a right bracket (\"\", \")\", \"]\"), leading or trailing white space.",
  357. "tags":"",
  358. "source":"https://github.com/trinker/qdapRegex/"
  359. },
  360. {
  361. "name":"Text, Whitespace Bracket",
  362. "regex":"(\\s+)(?=[\\)\\]\\}])|(?<=[\\(\\[\\{])(\\s+)",
  363. "description":"Detects white space after a left bracket (\"\", \"(\", \"[\") or before a right bracket (\"\", \")\", \"]\").",
  364. "tags":"",
  365. "source":"https://github.com/trinker/qdapRegex/"
  366. },
  367. {
  368. "name":"Text, Whitespace Before Colon",
  369. "regex":"(\\s+)(?=[\\:\\;]+)",
  370. "description":"Detects white space before a single or consecutive combination of a colon, semicolon.",
  371. "tags":"",
  372. "source":"https://github.com/trinker/qdapRegex/"
  373. },
  374. {
  375. "name":"Text, Whitespace Before Comma",
  376. "regex":"(\\s+)(?=,)",
  377. "description":"Detects white space before a comma.",
  378. "tags":"",
  379. "source":"https://github.com/trinker/qdapRegex/"
  380. },
  381. {
  382. "name":"Text, Whitespace After Comma",
  383. "regex":"(?!\\s+),(?=\\D)",
  384. "description":"Detects white space after a comma.",
  385. "tags":"",
  386. "source":"https://github.com/trinker/qdapRegex/"
  387. },
  388. {
  389. "name":"Text, Whitespace Before Endmark",
  390. "regex":"\\s+(?=[.?!](?:\\D|$))",
  391. "description":"Detects white space before endmark(s) (\".\", \"?\", \"!\").",
  392. "tags":"",
  393. "source":"https://github.com/trinker/qdapRegex/"
  394. },
  395. {
  396. "name":"Text, Whitespace Leading",
  397. "regex":"^\\s+",
  398. "description":"Detects leading white space.",
  399. "tags":"",
  400. "source":"https://github.com/trinker/qdapRegex/"
  401. },
  402. {
  403. "name":"Text, Whitespace Leading or Trailing",
  404. "regex":"^\\s+|\\s+$",
  405. "description":"Detects leading or trailing white space.",
  406. "tags":"",
  407. "source":"https://github.com/trinker/qdapRegex/"
  408. },
  409. {
  410. "name":"Text, Whitespace Multiple",
  411. "regex":"(\\s+)(?=[\\s])",
  412. "description":"Detects multiple white space (more than single whitespace element).",
  413. "tags":"",
  414. "source":"https://github.com/trinker/qdapRegex/"
  415. },
  416. {
  417. "name":"Text, Whitespace Before Punctuation",
  418. "regex":"\\s+(?=[.](?:\\D|$))|(\\s+)(?=[,]|[;:?!]+)",
  419. "description":"Detects multiple white space before a comma, white space before a single or consecutive combination of a colon, semicolon, or endmark (period, question mark, or exclamation point).",
  420. "tags":"",
  421. "source":"https://github.com/trinker/qdapRegex/"
  422. },
  423. {
  424. "name":"Text, Whitespace Trailing",
  425. "regex":"\\s+$",
  426. "description":"Detects trailing white space.",
  427. "tags":"",
  428. "source":"https://github.com/trinker/qdapRegex/"
  429. },
  430. {
  431. "name":"Semantic Version",
  432. "regex":"\\b(v(ersion)*\\s*)([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:\\.([0-9]+))?\\b",
  433. "description":"Detects semantic version numbers like <code>0.1.5</code> or <code>3.4.4.9034</code> prefaced with <code>v</code> or <code>version<code>.",
  434. "tags":"",
  435. "source":"https://github.com/trinker/qdapRegex/"
  436. }
  437. ]