php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73541 Hyphenated Word Unidentified
Submitted: 2016-11-16 12:01 UTC Modified: 2016-11-16 12:11 UTC
From: amall at actistence dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: amall at actistence dot com
New email:
PHP Version: OS:

 

 [2016-11-16 12:01 UTC] amall at actistence dot com
Description:
------------
Hyphenated word (https://en.oxforddictionaries.com/definition/in-law) unmatched in word identification.

Test script:
---------------
preg_match("(\w+)", "in-law", $matches);
print_r($matches);


Expected result:
----------------
Array
(
    [0] => in-law
)

Actual result:
--------------
Array
(
    [0] => in
)

Patches

in-law (last revision 2016-11-16 12:02 UTC by amall at actistence dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-16 12:11 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: *Regular Expressions +Package: PCRE related
 [2016-11-16 12:11 UTC] requinix@php.net
\w does not match hyphens.

http://www.regular-expressions.info
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 11:01:34 2025 UTC