Skip to main content
Inspiring
July 3, 2026
Question

problem with a regular expression

  • July 3, 2026
  • 5 replies
  • 48 views

Hello,

My regular expression is :

, (\b.+\b)\n

 ($1),  

 

In this document all is working well except for the last line (see blue arrow) where it is not able to find the last text, ie :  , tuba

Why ?

 

 

    5 replies

    Inspiring
    July 3, 2026

    @frameexpert 

    In that case, have you something better than   \n    you advise me to use ?

    Inspiring
    July 3, 2026

    @frameexpert 

    I have a problem with the change in the regular expression from \n  to  $  :

     

    ---  If I use   , (\b.+\b)\n   (like before),  I have this :

     

    ---  If I use , (\b.+\b)$  I have this :

     

    The problem is that by doing “find” I need to remove also the space after “flute de voix” in order that the next line will be automatically added after “flute de voix”.

    frameexpert
    Community Expert
    Community Expert
    July 3, 2026

    Try this: (\n|$)

    www.frameexpert.com
    Inspiring
    July 3, 2026

    @frameexpert 

    I have tried this :

    , (\b.+\b)(\n|$)

     ($1),  

    It works until the end, but I have a little problem when there is a blank line after :

    Before the change :

     

    after the change :

    In this example, after “accordéon” there is a blank line, and the result after change  is :

    (accordéon),      so there is a comma and the blank line is removed.

     

    But  I would like something like :

    (accordéon)       without the comma and by keeping the blank line after

     

    In that case, what regular expression I can use ?

    Inspiring
    July 3, 2026

    Here is the page with the text symbols.

    @Jeff_Coatsworth  :  if I add a blank line after   , tuba : it succeed to find  , tuba   .   Why am I obliged to add a blank line after in that case ?

    @frameexpert  : by replacing   \n with $ : it works.  In order to understand, why have you choosed  $  instead of   \n   in that case ?

     

     

    frameexpert
    Community Expert
    Community Expert
    July 3, 2026

    \n means new paragraph and you don’t have a new paragraph after the last line. $ means at the end of the line.

    www.frameexpert.com
    frameexpert
    Community Expert
    Community Expert
    July 3, 2026

    Replace the \n with $ and see what happens.

    www.frameexpert.com
    Jeff_Coatsworth
    Community Expert
    Community Expert
    July 3, 2026

    Can’t tell exactly since you don’t have text symbols turned on, but what happens if you add a new paragraph after “, tuba”?