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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 - 48 = ?
Subscribe to this entry?

 
 [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)

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 02:01:28 2024 UTC