{"id":42179,"date":"2021-09-01T19:24:41","date_gmt":"2021-09-01T19:24:41","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=42179"},"modified":"2021-09-01T19:24:42","modified_gmt":"2021-09-01T19:24:42","slug":"php-regex-is-hyphen-a-word-character","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/php-regex-is-hyphen-a-word-character\/","title":{"rendered":"PHP: regex: is hyphen a word character?"},"content":{"rendered":"\n<h2>Self-tutoring about PHP and regular expressions: the tutor looks into whether hyphen is a word character.<\/h2>\n<p>\nFrom time to time I wonder about this &#8212; I think I knew but have forgotten. Anyway, I&#8217;ve checked today and it seems that the hyphen is not a member of the word character class in PHP. Said in another way, in PHP regex, \\w doesn&#8217;t include the &#8211; character, so far as I&#8217;m aware.\n<\/p>\n<p>Source:<\/p>\n<p><a href=\"https:\/\/www.w3schools.com\/php\/phptryit.asp?filename=tryphp_regex_match\">w3schools.com<\/a><\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about PHP and regular expressions: the tutor looks into whether hyphen is a word character. From time to time I wonder about this &#8212; I think I knew but have forgotten. Anyway, I&#8217;ve checked today and it seems that &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/php-regex-is-hyphen-a-word-character\/\"> <span class=\"screen-reader-text\">PHP: regex: is hyphen a word character?<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2955],"tags":[],"class_list":["post-42179","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=42179"}],"version-history":[{"count":3,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42179\/revisions"}],"predecessor-version":[{"id":42182,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/42179\/revisions\/42182"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=42179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=42179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=42179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}