Skip to main content
Community Expert
September 3, 2021
Answered

Find non-breaking space with regular expression

  • September 3, 2021
  • 2 replies
  • 8933 views

Hi,

 

This is just for info, if anyone else needs to find non-breaking spaces with regular expressions.

"\ " or \u00A0 or \s does not work.

And it took me half an hour to find out that I have to use this notation:

\x11 (in the online help in the appendix in Windows character sets; not described in the section about Find and Regular expressions)

Characters in Unicode notation are generally not found with regular expressions.

 

Best regards

 

Winfried

 

 

    This topic has been closed for replies.
    Correct answer frameexpert

    Thanks Winfried. You can use this as substitute for \s in FrameMaker regular expressions:

    [\x08-\x14\x20]+

    2 replies

    Bob_Niland
    Community Expert
    Community Expert
    September 3, 2021

    Perhaps we separately need some discussion of how FM renders and publishes non-breaking spaces.

    \x11 and \u00a0 are not, today, the same thing.

    \x11 gets honored during FM edit and text layout, gets rendered as a plain U+0020 space to PDF (based on a test), and based on this thread that appeared the same day, may get rendered as   to HTML.

    \u00a0 (U+00A0 NO-BREAK SPACE), based on a casual test, is not honored for FM edit/layout, and I haven't tested how it renders to PDF or HTML.

    frameexpert
    Community Expert
    frameexpertCommunity ExpertCorrect answer
    Community Expert
    September 3, 2021

    Thanks Winfried. You can use this as substitute for \s in FrameMaker regular expressions:

    [\x08-\x14\x20]+

    Community Expert
    September 3, 2021

    Rick, thank you very much! I will remember this info!