Convert C# regex Code to Java -
i have found regex extractor code in c#. can tell me how works, , how write equivalent in java?
// extract songtitle metadata header. // trim needed, because stations don't trim songtitle filename = regex.match(metadataheader, "(streamtitle=')(.*)(';streamurl)").groups[2].value.trim();
this should want.
// create regex pattern pattern p = pattern.compile("(streamtitle=')(.*)(';streamurl)"); // create matcher matches pattern against input matcher m = p.matcher(metadataheader); // if found match if (m.find()) { // filename second group. (the `(.*)` part) filename = m.group(2); }
Comments
Post a Comment