PHP's `preg_match_all` functionality in Java

icecore

New Member
In PHP if we need to match a something like, \[code\]["one","two","three"]\[/code\], we could use the following regular expression with \[code\]preg_match\[/code\].\[code\]$pattern = "/\[\"(\w+)\",\"(\w+)\",\"(\w+)\"\]/"\[/code\]By using the parenthesis we are also able to extract the words one, two and three. I am aware of the \[code\]Matcher\[/code\] object in Java, but am unable to get similar functionality; I am only able to extract the entire string. How would I go about mimicking the \[code\]preg_match\[/code\] behaviour in Java.
 
Back
Top