richardsimnett
asked on
I need a regular expression...
Hello,
I need a regular expression (I'm not familiar with them), to be used with String.replaceall. It needs to match and replace the following characters comma, double quote, carriage return, and linefeed. If you could also explain how it works so that I can start learning how to do this that would be great.
Worth 500 points.
Thanks,
Rick
I need a regular expression (I'm not familiar with them), to be used with String.replaceall. It needs to match and replace the following characters comma, double quote, carriage return, and linefeed. If you could also explain how it works so that I can start learning how to do this that would be great.
Worth 500 points.
Thanks,
Rick
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
[,\"\r\n]
[] defines characters classes, in this case to match any character character listed
carriage return is specified by \r
new line is specified using \n
" needs to be escaped in a java string \" so it isn't treated as closing the string
carriage return is specified by \r
new line is specified using \n
" needs to be escaped in a java string \" so it isn't treated as closing the string
:-)