0

I am trying to find abstract all occurrences of a function call in a full project in Webstorm. The issue is that the function call may be broken into multiple lines for readability, hence I am trying to use regex for this.

foobar(a,b
c,d);

foobar(e,f,g,h);

I am trying to use regex foobar[\S\s]*\);? to get both the calls as separate occurrences but I keep getting one match only with the entire text highlighted(greedy result). What am I doing wrong with respect to the non greedy reg ex?

a.utfull.day
  • 72
  • 1
  • 12
  • 1
    Why do you need a regex? https://www.jetbrains.com/help/webstorm/find-usages-dialog.html – jonrsharpe Jun 29 '20 at 07:35
  • @jonrsharpe I want to be able to abstract all the usages in a text file, and in doing that it only records the call till the end of the line and not the whole call, thats why manually using regex – a.utfull.day Jun 29 '20 at 07:38
  • But *why*? What do you mean *"abstract all occurrences of a function call"*? – jonrsharpe Jun 29 '20 at 07:38
  • The final goal is to search a specific function calls which contain some special parameters. Since I need the entire call for that I want to first get all the usages in 1 text file and then proceed to find from the list of parameters. @jonrsharpe – a.utfull.day Jun 29 '20 at 07:43
  • @a.utfull.day SSR: Structural Search and Replace? It should help with such specific requirements (search wise of course) https://www.jetbrains.com/help/webstorm/structural-search-and-replace.html and https://www.jetbrains.com/help/webstorm/structural-search-and-replace-examples.html – LazyOne Jun 29 '20 at 10:36

0 Answers0