java - Decipher this regex -


i came project working on several months ago, , 1 problem figured out when need extract part of string. string used both paranthesis , quotationmarks, couldn't split normal text.

example of how string might look:

word_object("id"): preword:subword

now wanted grab what's after ("id"):,

'preword:subword'

i found regex helped me out, , took quite time find example applicable wanted. had settle example, because tried find sources on how learn incredibly complex system failed hard @ that. regex solved looks this: "word_object(\\(\"" + "id" + "\")\\): "

i content seemed work, when got project , tried it, trying extract word used underscore _and underscore following word(s) left out.

example, splitting text word_object("id"): preword:subword_underscorewordusing regex (using complete line now) idsplit = subtemp.split("word_object(\\(\"" + "id" + "\")\\): ");would return: preword:subwordinstead of wanted preword:subword_underscoreword.

did somehow in regex instruct ignore after 2nd special-character (since accept :, apparently _ breaks everything)?

public static void main(string[] args) {     final string[] split = "word_object(\"id\"): preword:subword_underscoreword".split("word_object(\\(\"" + "id" + "\")\\): ");     system.out.println("split = " + split[1]); } 

leads to

split = preword:subword_underscoreword 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -