extract string from string javascript based on word

Solutions on MaxInterview for extract string from string javascript based on word by the best coders in the world

showing results for - "extract string from string javascript based on word"
Veronica
19 Jan 2018
1var str = '#anotherdata=value#iamlookingforthis=226885#id=101&start=1';
2var value = str.match(/#iamlookingforthis=(\d+)/i)[1];
3
4alert(value); // 226885