Skip to content

Instantly share code, notes, and snippets.

@anovsiradj
Last active Aug 14, 2019
Embed
What would you like to do?
replace non-number and/or non-alphabet from string use free pascal
// fpc~3 //
program HelloWorld;
uses RegExpr;
var rgx_1,rgx_2,str_1 :string;
var rst :string;
begin
rgx_1 := '[^0-9]+';
rgx_2 := '[^a-zA-Z]+';
rgx_2 := '[^0-9a-zA-Z]+';
str_1 := '1.333-4444 999 f- 00+122';
rst := ReplaceRegExpr(rgx_3, str_1, '', True);
WriteLn(rst);
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment