Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function extractSent(input) {
- let quer = input[0]
- let text = input[1];
- //const pattern = /(\w[^.!?]*)?\b/q+quer+/\b[^.!?]*[^.!?]/g;
- let pat = new RegExp("(\\w[^.!?]*)?\\b"+quer+"\\b[^.!?]*[^.!?]", "g");
- let matches = text.match(pat);
- if(matches!=null){
- for(let m of matches){
- console.log(m.trim());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement