Skip to main content
Community Expert
Sep 3, 2021 10:13 AM UTC
Answered

Find non-breaking space with regular expression

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 is closed to new replies. Start a new post to keep the conversation going.
    frameexpert
    frameexpertCorrect answer
    Community Expert
    Sep 3, 2021 12:26 PM UTC

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

    [\x08-\x14\x20]+

    www.frameexpert.com

    3 replies

    Bob_Niland
    Community Expert
    Community Expert
    Sep 3, 2021 1:49 PM UTC

    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.

    Translate
    frameexpert
    Community Expert
    frameexpertCommunity ExpertCorrect answer
    Community Expert
    Sep 3, 2021 12:26 PM UTC

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

    [\x08-\x14\x20]+

    Translate
    www.frameexpert.com
    Community Expert
    Sep 3, 2021 12:28 PM UTC

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

    Translate