[Python] Convert reg-ex across all files in folder

Discussão em 'Python' iniciado por Stack, Dezembro 8, 2024.

  1. Stack

    Stack Membro Participativo

    I am a novice with reg-ex and would like to know how to convert the following in every c file in a folder.

    #Before
    TEST_RESULTS *setAll = FIXED(TEST_VALUES_ONE);

    #After
    TEST_RESULTS *setAll = FIXED_SET(setAll, TEST_VALUES_ONE);


    The only constant in this is FIXED, whereas the others are variables and will have different names throughout the files. One other thing some of the files with this expression cover two lines. Does that need to be different I guess? e.g.

    TEST_RESULTS_TWO *setAllTwo =
    FIXED(TEST_VALUES_ONE));


    Preferably carried out in python/perl

    Continue reading...

Compartilhe esta Página