You are here: PSPad forum > English discussion forum > replace all non alphanumeric signs with spaces

replace all non alphanumeric signs with spaces

#1 replace all non alphanumeric signs with spaces

Posted by: trevor12 | Date: 2014-09-17 23:08 | IP: IP Logged

hello, is it possible use RegEx (in Search-Replace) to clean one my 0,5 mb *.txt file (plain text) from non alphanumeric signs ? For my need (and my Czech language) "alphanumeric" are only a-z, A-Z, č, ď, é, ě, ň, ř, š, ť, ú, ů, ž, Č, Ď, É, Ě, Ň, Ř, Š, Ť, Ú, Ž, space, dot, !, ?, 0-9.

Everything else sign ("letter") I want "be replaced for space (or nothing)"

Options: Reply | Quote | Up ^


#2 Re: replace all non alphanumeric signs with spaces

Posted by: Andreas | Date: 2014-09-18 00:15 | IP: IP Logged

Did you try this?

[^a-zA-ZčďéěňřšťúůžČĎÉĚŇŘŠŤÚŽ .!?0-9]

Infos:
https:// developer.mozilla.org /en-US/docs/Web/JavaScript/Guide/Regular_Expressions

Try it first in a regex tester:
http:// regexpal.com /

Options: Reply | Quote | Up ^


#3 Re: replace all non alphanumeric signs with spaces

Posted by: trevor12 | Date: 2014-09-18 06:47 | IP: IP Logged

thank you for advice, I try regexpal.com and add some signs for my need so final regex is:

[^a-zA-Záý,íčďéěňřšťúůžČĎÉĚŇŘŠŤÚŽ .!?0-9]

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR