Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004019OCamlOCaml documentationpublic2006-05-04 19:362012-09-11 16:45
Assigned To 
PlatformOSOS Version
Product Version3.09.0 
Target Version4.00.1+devFixed in Version 
Summary0004019: Str.matched_string also takes into account the matching occuring in Str.global_substitute
DescriptionThe documentation of Str.matched_string says "matched_string s returns the substring of s that was matched by the latest Str.string_match, Str.search_forward or Str.search_backward."

It should says "matched_string s returns the substring of s that was matched by the latest Str.string_match, Str.search_forward, Str.search_backward or Str.global_substitute."

Other functions of the Str module are probably to be added to the list.


#load "str.cma"
let r = Str.regexp "\\([a-z]\\)\\([A-Z]\\)"
let subst line =
  let s = Str.matched_string line in
  assert (String.length s = 2);
  Printf.sprintf "%c_%c" s.[0] (Char.lowercase s.[1])
Str.global_substitute r subst "camlCase and caml_style"


- : string = "caml_case and caml_style"
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2012-09-11 16:45

Fixed in 4.00.1+dev (r 12921) and trunk (r 12923).

- Issue History
Date Modified Username Field Change
2006-05-04 19:36 jrouquie New Issue
2006-08-29 18:02 doligez Status new => acknowledged
2012-09-06 16:44 doligez Target Version => 4.00.1+dev
2012-09-11 16:45 doligez Note Added: 0008070
2012-09-11 16:45 doligez Status acknowledged => closed
2012-09-11 16:45 doligez Resolution open => fixed

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker