regex - Find substring and match until character appears -
i have want extract part comes after url:' , until hit next '
so basicly when doing regexpt far url:[*.'] wrong cause dont want include url in match.
from text below there should 2 matches gives me
/company/513092-1/jk-servicemontage-ab /company/515413-1/energi-o-inneklimat-i-norrkoping-ab
my text file looks like.
[{company:'jk servicemontage ab', kundnr:'513092-1', icon:'', url:'/company/513092-1/jk-servicemontage-ab', lat:'59.3159923', long:'18.277547599999934', adress:'ripvägen 4 b 13247 saltsjÖ boo sweden'},{company:'energi & inneklimat norrköping ab', kundnr:'515413-1', icon:'', url:'/company/515413-1/energi-o-inneklimat-i-norrkoping-ab', lat:'58.59852349999999', long:'16.1451237', adress:'fridhemsvägen 3 60213 norrkÖping sweden'}]
you use
(?<=url:').*?(?=')
(?<=url:')
- lookbehindurl:'
.*?
- non-greedy findall(?=')
- lookahead closing quote'
Comments
Post a Comment