StringReplace does not work correctly
Original Reporter info from Mantis: yus
-
Reporter name: Yuri Serebrennikov
Original Reporter info from Mantis: yus
- Reporter name: Yuri Serebrennikov
Description:
If you try to replace the symbol '?' StringReplace does not work correctly.
Error from Browser console.
sysutils.pas:2162 Uncaught SyntaxError: Invalid regular expression: /?/: Nothing to repeat
at new RegExp (<anonymous>)
at Object.StringReplace (sysutils.pas:2162)
at Object.$mod.$main (test.lpr:17)
at doRun (rtl.js:143)
at Object.run (rtl.js:158)
at test.html:11
Steps to reproduce:
Create project "Web Browser Application"
Insert next code.
program test;
{$mode objfpc}
uses
JS,
Classes,
SysUtils,
Web;
var
str: string;
begin
str := 'a?,b,c';
writeln(str);
str := StringReplace(str, '?', '', [rfReplaceAll]);
writeln(str);
end.
Mantis conversion info:
- Mantis ID: 38224
- Build: Lazarus 2.0.10 (SVN: 63526)
- Fixed in version: trunk
- Fixed in revision: 1028