Search in files

  • Hello, can I do a file search (Ctrl + Shift + F) of two words on the same line? thanks.

  • @Francisco

    I guess, yes.

  • Hello, @francisco and All,

    A short example :

    Let’s suppose you’re looking for all the lines of all files, in a specific directory, containing, both, the two strings You and there

    Three questions arise :

    • Do you mind the case of the strings or not ( YOU, There, yoU, THEre, … )

    • Do you mind if the strings You and there are true words or part of words like Your and therefore ?

    • Does the string You always come before the string there or the opposite or both situations may occur ?

    So, here are 4 regular expressions for each case. Note that I suppose that, both, word_1 or word_2 may occur first, in current line :

    • Regex A : (?-is)You.*there|there.*You for a search of strings You and there, with this exact case

    • Regex B : (?i-s)You.*there|there.*You for a search of strings You and there, whatever their case

    • Regex C : (?-is)\bYou\b.*\bthere\b|\bthere\b.*\bYou\b for a search of words You and there, with this exact case

    • Regex D : (?i-s)\bYou\b.*\bthere\b|\bthere\b.*\bYou\b for a search of words You and there, whatever their case

    Of course, you must select the Regular expression search mode

    The (?-s) in-line modifier ensures that the regex engine will interpret the dot ( . ) as matching a single standard character and not the line-break chars !

    Hope this helps :-)

    Best Regards,


  • Very thanks guy038, I will try

  • Please, guyo38, help me, I have a file with some lines: I need to do a search for 144 and JU44…
    144 FX 2020-06-13 1427 PU3LJY GG67 PMVUV FG67
    144 FT 2020-06-13 1741 PL4JYU GG68 PH7NS HG68
    144 FO 2020-06-13 1752 PM2LJY GG77 PD9MM JU44

  • Hi @Francisco,

    I think you will get what you want if you replace “You” with “144” and “there” with “JU44” in @guy038’s third Regular Expression, above.

    Take care.

  • Hi, @francisco and All,

    Yes, as @astrosofista said, I suppose that you need the regex C of my previous post :

    Thus, in your case, the regex becomes (?-is)\b144\b.*\bJU44\b

    Note that I even shortened this regex as the number 144 comes before the word JU44 !

    Best Regards


  • Now sucess, very thanks guy038 and all… Take care.

Log in to reply