{"id":2017,"date":"2021-06-01T13:32:50","date_gmt":"2021-06-01T13:32:50","guid":{"rendered":"http:\/\/optimumsportsperformance.com\/blog\/?p=2017"},"modified":"2021-06-01T13:32:50","modified_gmt":"2021-06-01T13:32:50","slug":"tidyx-61-regular-expressions-101","status":"publish","type":"post","link":"https:\/\/optimumsportsperformance.com\/blog\/tidyx-61-regular-expressions-101\/","title":{"rendered":"TidyX 61: Regular Expressions 101"},"content":{"rendered":"<p>One of the less glamorous tasks in data science is data cleaning. Because data can come in many different forms, it is off &#8220;dirty&#8221; and requires some level of treatment prior to analysis. One of the more complex data cleaning tasks is working with strings and <strong>regular expressions<\/strong>.<\/p>\n<p>Regular expressions can both look intimidating and daunting as parsing strings requires a lot of <em>weird <\/em>looking characters. For example, look at this regular expression <span style=\"color: #0000ff;\"><strong><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/jcheng\/status\/1398321973369839617\">Joe Cheng<\/a><\/strong><\/span> shared on Twitter recently:<a href=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2021\/06\/Screen-Shot-2021-06-01-at-6.24.26-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-2018\" src=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2021\/06\/Screen-Shot-2021-06-01-at-6.24.26-AM-974x1024.png\" alt=\"\" width=\"466\" height=\"490\" srcset=\"https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2021\/06\/Screen-Shot-2021-06-01-at-6.24.26-AM-974x1024.png 974w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2021\/06\/Screen-Shot-2021-06-01-at-6.24.26-AM-285x300.png 285w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2021\/06\/Screen-Shot-2021-06-01-at-6.24.26-AM-768x807.png 768w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2021\/06\/Screen-Shot-2021-06-01-at-6.24.26-AM-624x656.png 624w, https:\/\/optimumsportsperformance.com\/blog\/wp-content\/uploads\/2021\/06\/Screen-Shot-2021-06-01-at-6.24.26-AM.png 1252w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/a><\/p>\n<p>As such, this week on TidyX, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/twitter.com\/ellis_hughes\">Ellis Hughes<\/a><\/span><\/strong> and I begin a series on regular expressions and start with Regular Expressions 101. We cover:<\/p>\n<ul>\n<li>Searching strings for key words<\/li>\n<li>Manipulating the string<\/li>\n<li>Extracting components of the string<\/li>\n<li>Splitting the string based on a specific character<\/li>\n<li>Regular expression anchors<\/li>\n<li>Matching within the string<\/li>\n<\/ul>\n<p>To watch the screen cast, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/www.youtube.com\/watch?v=4HLXfpDVb-o\">CLICK HERE<\/a><\/span><\/strong>.<\/p>\n<p>To access our code, <strong><span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"https:\/\/github.com\/thebioengineer\/TidyX\/blob\/master\/TidyTuesday_Explained\/061-Data_Cleaning_Regular_Expressions\/Episode%2061%20-%20Data%20Cleaning%20Intro.R\">CLICK HERE<\/a><\/span><\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the less glamorous tasks in data science is data cleaning. Because data can come in many different forms, it is off &#8220;dirty&#8221; and requires some level of treatment prior to analysis. One of the more complex data cleaning tasks is working with strings and regular expressions. Regular expressions can both look intimidating and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[],"class_list":["post-2017","post","type-post","status-publish","format-standard","hentry","category-tidyx-screen-cast"],"_links":{"self":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/comments?post=2017"}],"version-history":[{"count":1,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2017\/revisions"}],"predecessor-version":[{"id":2019,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/posts\/2017\/revisions\/2019"}],"wp:attachment":[{"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/media?parent=2017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/categories?post=2017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/optimumsportsperformance.com\/blog\/wp-json\/wp\/v2\/tags?post=2017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}