0

I'm getting mad, can't get it to work and can't find a solution. So how can I inverse the following regular expression? All tested strings should match - except those including "dist" or "node_modules". It need this regex for Electron Packager build command to ignore all folders/files excepts those having the string in path name.

regular expression to be inversed: (?=dist|node_modules)\S+

Lord Midi
  • 754
  • 1
  • 9
  • 25
  • Please check https://stackoverflow.com/questions/406230/regular-expression-to-match-a-line-that-doesnt-contain-a-word, maybe `^(?!.*(dist|node_modules)).*` or `^(?!.*(dist|node_modules))` is all you need. – Wiktor Stribiżew May 22 '19 at 07:00
  • This question may contain the solution you require: https://stackoverflow.com/questions/164414/how-to-inverse-match-with-regex – neophytte May 22 '19 at 07:03
  • I checked a lot of questions before - in a regex checker the example by Wiktor Stribiżew works but in this case I have to provide it as a command line parameter in bash and it doesn't work. aaaargh – Lord Midi May 22 '19 at 08:31

1 Answers1

0

conclusion: it was not possible to find a working RegEx which will do the job in combination with Electron packager. I used a custom packaging script instead where it's possible to use NodeJS an delete folders or whatever your app needs.

Lord Midi
  • 754
  • 1
  • 9
  • 25