0

i need to replace in something like hundred of files the use of _get method, so lets say i have hunders of files with some lines of code that looks like this:

_get(s, 'ex.am.ple', '');

which i want to replace to be like this:

s?.ex?.amp?.ple || '';

is there is some way to automate this proccess somehow with some script? i am not so familiar with script writing, i writed once some scripts on linux but this is on windows though

VLAZ
  • 26,331
  • 9
  • 49
  • 67
  • Why not just define your own `_get` instead of replacing all of them? [Accessing nested JavaScript objects and arrays by string path](https://stackoverflow.com/q/6491463) – VLAZ May 26 '22 at 14:53
  • I think it's doable with a well written regular expression, i'm not very good at thoose unfortunately – coglialoro May 26 '22 at 14:53
  • @coglialoro I wouldn't recommend using a regular expression to parse a programming language source code. – VLAZ May 26 '22 at 14:56

0 Answers0