| Anonymous | Login | Signup for a new account | 2013-05-23 03:42 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0003778 | OCaml | OCaml general | public | 2005-08-31 16:30 | 2005-10-12 14:58 | ||||||
| Reporter | administrator | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | feature | Reproducibility | always | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| Target Version | Fixed in Version | ||||||||||
| Summary | 0003778: \\2 in global_replace | ||||||||||
| Description | Full_Name: mattias waldau Version: 3084 OS: WinXP Submission from: c-328ae253.09-253-7570701.cust.bredbandsbolaget.se (83.226.138.50) Got bitten by the \\2 feature of global_replace. I had code that substitute in a string from the user into a string and it contained \\, i.e. replace_first (String.regexp_string "{1}") "new_hire_training1\\2" txt and of course it failed. The solution is of course to use substitute_first instead, i.e. substitute_first arg1_regexp (fun _ -> "new_hire_training1\\2") txt Although this is of course a bit overkill for a simple search-replace. Suggestion: 1. Introduce a simple search-replace function that replace a substring with another substring without any use of regexp or templ 2. Introduce a function quote_tmpl that quotes \\ and mention it in the documentation of global_replace and substitute_first | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2005-11-18 10:13 | administrator | New Issue | |
| Copyright © 2000 - 2011 MantisBT Group |