Remove space fails in Studio

Every now and then I try to remove a space or non-breaking space via a regex. Unfortunately it does not work in Studio. Why? It works in .Net. Can this be repaired?

Here is an example: I try to remove the space between +/- and a number (eg. + 23 % should be +23 %)

Regex: (?<!\d\s?)([\+-])\s(\d)

Replace with: $1$2

See http://regexstorm.net/tester?p=%28%3f%3c!%5cd%5cs%3f%29%5c%2b%5cs%28%5cd%29&i=ca+4+%2b+3%2c56+%3d%0d%0a%28%2b+45+%25%29%0d%0aca.+%2b+68%0d%0a6%2b+99+%3d+105&r=%2b%241

emoji
Parents
  •  

    Your best bet is to use the SDLXLFF Toolkit from the appstore.  The use of backreferences in Studio search & replace has a bug and won't work.  I know it's been worked on so should be fixed in a future update.

    Either that or do some 2-step workaround similar to this...

    Step 1: Replace + with a unique identifier

    1. Search for +\s and replace it with some unique identifier, say PLUS_UNIQUEID
    2. Search for -\s and replace it with a different unique identifier, say MINUS_UNIQUEID

    Step 2: Replace the unique identifier back to its original symbol

    1. Search for PLUS_UNIQUEID and replace it with +
    2. Search for MINUS_UNIQUEID and replace it with -

    I reckon the SDLXLIFF toolkit is preferable!

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
Reply
  •  

    Your best bet is to use the SDLXLFF Toolkit from the appstore.  The use of backreferences in Studio search & replace has a bug and won't work.  I know it's been worked on so should be fixed in a future update.

    Either that or do some 2-step workaround similar to this...

    Step 1: Replace + with a unique identifier

    1. Search for +\s and replace it with some unique identifier, say PLUS_UNIQUEID
    2. Search for -\s and replace it with a different unique identifier, say MINUS_UNIQUEID

    Step 2: Replace the unique identifier back to its original symbol

    1. Search for PLUS_UNIQUEID and replace it with +
    2. Search for MINUS_UNIQUEID and replace it with -

    I reckon the SDLXLIFF toolkit is preferable!

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji
Children