vendredi 25 janvier 2019

Match regex multi-line while reading the file line by line

I have a file which I read line by line, and do the parsing with a regex which works fine. What I'm parsing is some functions names and their parameters (that's what I capture). In some files the function parameters are written multi-line, like this:

result = f(a, b,
c,
d
);

If it was written as result = f(a, b, c, d);, my regex works fine. How should I deal with the multi-line?

Aucun commentaire:

Enregistrer un commentaire