How does JAVA use regular expressions to extract strings between two strings

  java, question

The requirements are as follows, such as having such a string
String= “element[name=mobileCode, element[name=userID,”;
I want to extract the mobileCode and userID. both mobileCode and userID are preceded by “element[name=” in this form, followed by a “,”… how to extract it?

Direct s.split(“element[name= “) without regx.