davedpss Posted November 22, 2011 Share Posted November 22, 2011 I am trying to clean up some text that has some white space that I can't seem to get rid of. I have tried replacing \s, \t,\n, \r, \r\n etc. and that strips out most of the new lines but not all. When I look at in a text editor such as TextWrangler, I am seeing an upside down question mark where these spaces are. I thought instead of trying to match something and then deleting that I could try to delete everything but what matched. I don't know how to do this with regular expressions. If anybody had a pattern and a replacement that would work, I would appreciate it. Thanks - Dave. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 22, 2011 Share Posted November 22, 2011 You can use the ^ character at the start of a character class to say that you want to match anything not in that class. http://www.php.net/manual/en/regexp.reference.character-classes.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.