From the following String I want to match charaters between { }
I tested {"chkin.*"}
but in code it is not working
String re = "\\{\"chkin.*}";
pattern = Pattern.compile(re);
matcher = pattern.matcher(document.html());
document = {"chkin":"2018/1/18","chkout":"2018/1/19","adults":"2","children":"1","childAge":"2","brandId":"2199","packageType":null,"countryId":0,"isVip":false,"swpToggleOn":null,"cacheId":null,"tla":"NGO","stayLength":null,"daysInFuture":null,"ticketedTravelers":null,"evalMODExp":true,"partnerName":"","partnerPrice":"0.0","partnerCurrency":"","partnerTimestamp":"0"},"taapPackageRateEnabled":false,"loyaltyData":{"rewardsAmount":0,"formattedRewardsAmount":null,"rewardsDollarValue":null,"redemptionFloorAmount":0,"expediaPlusBranded":"Expedia+","expediaPointsBranded":"Expedia+ points","awardType":"points","hasLoyaltyEarnings":true,"hasGPSLoyaltyEarnings":false,"tier":null,"swpToggleDefaultState":true,"canUserBurn":false,"displaySwpToggle":null},"displayQualifyingNights":false,"showExcludeTaxMessage":true,"showNoRefundIcon":false,"drrMessageForGPSEnabled":false,"omnitureData":
This document is a very large html
file I am showing only part of it.
Fixed :
Problem was at document.html() part of code. Actually document was a huge html
file that I have shown just a part. So Intellij Idea
was complaining that very large String constant inside matcher
. So I divided large html
file into chunks and then regex suggested by @Bohemian worked perfectly fine. Thanks