M
Mik
Hi,
I need the functionality of Perl tr (or Unix tr command) in a C
function. I mean replacing each character of a list of characters with
the character in another counterpart list. For example:
char* str = "hello";
printf("original string: '%s'\n", str);
tr(str, "ho", "jy");
printf("transliterated string: '%s'\n", str);
Which must end up printing:
original string: 'hello'
transliterated string: 'jelly'
It would be great if it recognizes Perl regexp syntax like [A-Z], \d,
\s and so on, so calls like tr(str, "[eo]","-") make str = "h-ll-".
Does anybody know if there is a public library which implements this
functionality?. I've looked at glib but can't find something similar.
I need the functionality of Perl tr (or Unix tr command) in a C
function. I mean replacing each character of a list of characters with
the character in another counterpart list. For example:
char* str = "hello";
printf("original string: '%s'\n", str);
tr(str, "ho", "jy");
printf("transliterated string: '%s'\n", str);
Which must end up printing:
original string: 'hello'
transliterated string: 'jelly'
It would be great if it recognizes Perl regexp syntax like [A-Z], \d,
\s and so on, so calls like tr(str, "[eo]","-") make str = "h-ll-".
Does anybody know if there is a public library which implements this
functionality?. I've looked at glib but can't find something similar.