So I need to compile a pattern that includes a set of " " inside it . It won't do the job any other pattern Using this pattern compare.
Pattern urlPattern = Pattern.compile("<div class="thumb"><a href=(.*?)-t1");
I am reading about it and you need to do something like "\stuff\" but I just can't work it in the pattern above. Any help?
Escape your quotes:
Pattern myPattern = Pattern.compile("<div class=\"thumb\"><a href=(.*?)-t1");
Also, regex against HTML is usually considered to be bad practice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With