skip to Main Content

Reactjs – Regex: Not operator with grouped selection

As below pattern (currentStore.*?}.*?=.*?useApp) which search for a pattern like this: const {currentStore} = useApp(); But I need a pattern which search for a content where assignation of currentStore is happening like below(Not(currentStore.*?}.*?=.*?useApp)): currentStore = await MultiStoreService.getStoreInfoByLocation(zipCode, subdistrict); I mean…

VIEW QUESTION

Invalid regular expression error in javascript

If '[' special character is used in regex constructor object, it throws Invalid regular expression: /mat[/: Unterminated character class function findMatch() { var string="Find the match"; var text = "Mat["; string.replace(new RegExp(text, 'gi'), "found") } Why this error is occuring…

VIEW QUESTION
Back To Top
Search