Original bug ID: 4019 Reporter: jrouquie Status: closed (set by @damiendoligez on 2012-09-11T14:45:59Z) Resolution: fixed Priority: normal Severity: text Version: 3.09.0 Target version: 4.00.1+dev Category: documentation Monitored by: jrouquie
Bug description
The 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.
Test:
#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"
produces:
: string = "caml_case and caml_style"
The text was updated successfully, but these errors were encountered:
Original bug ID: 4019
Reporter: jrouquie
Status: closed (set by @damiendoligez on 2012-09-11T14:45:59Z)
Resolution: fixed
Priority: normal
Severity: text
Version: 3.09.0
Target version: 4.00.1+dev
Category: documentation
Monitored by: jrouquie
Bug description
The 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.
Test:
#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"
produces:
The text was updated successfully, but these errors were encountered: