troubleshooting Question

Java regular expressions to extract certain strings

Avatar of newone2011
newone2011 asked on
Java
20 Comments2 Solutions400 ViewsLast Modified:
I have  a complex string array where I have several different characters. I just want to extract certain data. For example, in the following I want o extract the msg after the mMsg which is "
Someone will be with you shortly" Also need to extract the timestamp which is indicated by:
mTsp and the timestamp follows as shown in bold below

O{bTyp | S{WCS-STD}bUsr | S{system}bUid | I{-1}sCmd | S{}sId | A{}sNme | S{}sUrl | S{}sLbl | S{}sCok | S{}mMsg | S{[Someone will be with you shortly.]}fAct | S{}fTyp | S{}fKey | S{}fVal | S{}bUserType | S{SYSTEM}transType | S{}mTsp | S{2011-12-08 23:58:30}}|O{bTyp | S{WCS-STD}bUsr | S{system}bUid | I{2238}sCmd | S{}sId | A{}sNme | S{}sUrl | S{}sLbl | S{}sCok | S{}mMsg | S{[You are now connected.]}fAct | S{}fTyp | S{}fKey | S{}fVal | S{}bUserType | S{SYSTEM}transType | S{}mTsp | S{2011-12-08 23:58:54}}|O{bTyp | S{WCS-STD}bUsr | S{Josh}bUid | I{2238}sCmd | S{}sId | A{}sNme | S{}sUrl | S{}sLbl | S{}sCok | S{}mMsg | S{Hello^2C  My name is Jack. How may I help you today?}fAct | S{}fTyp | S{}fKey | S{}fVal | S{}bUserType | S{AGENT}transType | S{}mTsp | S{2011-12-08 23:58:59}}|


Can I do this using java regular expressions or should I use string  manipulation ?  Can someone give a example for the above.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 20 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 20 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros