AlmarM 22 Posted September 23, 2010 Hiya! How do I replace all non "A-Z, a-z" characters inside a string? I think I should use StringRegExpReplace, but I have no idea how to get the right pattern. For example: User enters: "Europe" Action Taken: None, there are no other characters detected. User enters: " Europe" Action Taken: Replace " " with "" User enters: "12Europe" Action Taken: Replace "12" with "" User enters: "(Europe)" Action Taken: Replace "(", ")" with "" So as you can see, only "A-Z, a-z" characters are allowed. Thanks! MinesweeperA minesweeper game created in autoit, source available._Mouse_UDFAn UDF for registering functions to mouse events, made in pure autoit.2D Hitbox EditorA 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Share this post Link to post Share on other sites
Danny35d 15 Posted September 23, 2010 (edited) Try it:$UserEnters = ' 1(2E[u]ro)p e' MsgBox(0, "Regular Expression Replace Test", StringRegExpReplace($UserEnters, '[^a-zA-Z]|\W', '')) Edited September 23, 2010 by Danny35d AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Share this post Link to post Share on other sites
AlmarM 22 Posted September 23, 2010 Try it:$UserEnters = ' 1(2E[u]ro)p e' MsgBox(0, "Regular Expression Replace Test", StringRegExpReplace($UserEnters, '[^a-zA-Z]|\W', '')) Hey thanks! ^^ MinesweeperA minesweeper game created in autoit, source available._Mouse_UDFAn UDF for registering functions to mouse events, made in pure autoit.2D Hitbox EditorA 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Share this post Link to post Share on other sites