Getting specific values with regex

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-05-26T11:16:34Z Indexed on 2010/05/26 12:21 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

I need to knowingly isolate each row of the vCard and get its value.

For instance, I want to get "5555" from X-CUSTOMFIELD.

So far, my thoughts are:

"X-CUSTOMFIELD;\d+"

I have been looking at some tutorials and I am a little confused with what function to use? What would my regex above return? Would it give me the whole line or just the numerical part (5555)?

I was thinking I i get the whole row, I can use substring to get the digits?

BEGIN:VCARD
VERSION:2.1
N:Last;First;
FN:First Last
TEL;HOME;VOICE:111111
TEL;MOBILE;VOICE:222222
X-CUSTOMFIELD;5555
END:VCARD

© Stack Overflow or respective owner

Related posts about java

Related posts about android