I'm relatively new to Regex and feel that I've missed something important.
My pattern id='([a-zA-Z0-9]+)'
works for a C# version of the project I've made but doesn't in the java version.
I'm trying to grab the word "frame" from the string IFrame[id='frame'] .leftObject
.
Here is a link to the pattern and my code that I'm using. https://regex101.com/r/MmkGZq/2
String pattern = "id='([a-zA-Z0-9]+)'";
Pattern r = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
Matcher m = r.matcher(jQuerySelector); //<---jQuerySelector = "IFrame[id='frame'] .leftObject"
System.out.println(m.matches()); //<---returns false
return m.group(1);
Is it something to do with Regex in C# reading differently to Regex in Java?