Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18518
    timbradm
    Participant

    Hi there,
    I can’t figure out what’s wrong with my search regex. In my file, I’d like to find groups of lines not containing tab characters (\t) at the start of line, but only whole groups containing between 2-5 line occurrences, not single lines.
    So, in the below example, I’d like to get only two (2) search hits: “term01…term05”, and “term06…term07”.
    I wouldn’t like my search hits to switch from “term01…term05” to “term02…term05”, then to “term03…term05”, and “term04…term05”, before jumping to “term06…term07”. What am I doing wrong? I thought I understood the lookahead pattern system.
    Any suggestions would be appreciated, thank you.

    My regex (dot not matching new line character, ee v14.4.4):
    “^(?:[^\r\n\t].+(?:\r\n)){1,4}[^\r\n\t].*$”

    SAMPLE OF THE SEARCED TEXT:
    term01
    term02
    term03
    term04
    term05
    \t definition01
    \t definition02
    \t definition03
    term06
    term07
    \t definition04
    \t definition05
    term08
    \t definition06

    #18520
    Stefan
    Participant

    Hi Tim,

    I have not tried yet to understand what you want to do or if your expression is correct,

    but concerning your “dot not matching new line character,” issue,

    go and check the search settings, e.g. via “[Customize…]” button.

     
     

    #18521
    timbradm
    Participant

    Hi, Stefan,
    “Dot not matching new line character” obviously isn’t an issue of my writing. I suppose it has something to do with the lookahead behavior of EmEditor’s regex flavor. So I suggest you reread and test the search regex on the sample provided before recommending the Customize button…
    Regards

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.