I'm trying to write some code to scan an html file for, and return links to reviews of a game.
The file contains long URLs in quotes "". The specific URLs I am looking for will contain
the 'game name', and the word 'review'.
This is what I have so far:
Pattern p = Pattern.compile("http://.*?(?=.*gamename\\sreview).*?(?=\")");
Now I'm a great fan of regular expressions but that is just dreadful and provides ammunition for the guys round here who preach that regex were invented by the Devil.
In your OP you specified that the target would contain the word 'review' but I don't see it in your regex. Also, I assume the game name is supplied as a variable so this needs to be escaped so that none of it is interpreted as regex meta characters.