Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Str library: digits match \b #4874

Closed
vicuna opened this issue Sep 23, 2009 · 1 comment
Closed

Str library: digits match \b #4874

vicuna opened this issue Sep 23, 2009 · 1 comment
Assignees
Labels

Comments

@vicuna
Copy link

vicuna commented Sep 23, 2009

Original bug ID: 4874
Reporter: vbigiani
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2012-03-24T14:01:03Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.11.1
Fixed in version: 3.12.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: vbigiani

Bug description

The digits (0-9) match againt \b, as can be demonstrated by the following snippet:

let reg = Str.regexp "a\b";;
Str.string_match reg "a1" 0;;

which should return false, but instead returns true (because 1 is considered a word boundary).

@vicuna
Copy link
Author

vicuna commented May 19, 2010

Comment author: @xavierleroy

Changed the notion of word constituent in Str so that they include digits 0-9 and the _ character in addition to letters. This is more consistent with other regexp packages (Perl, Python, egrep).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants