Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

GREP to add space in specific query

Explorer ,
Oct 20, 2023 Oct 20, 2023

Hey there. I could use some help with a simple GREP I can use in Find/Replace to add a space after a an x, where it appears after a digit in a quantity. For example

2x 50L

should be 2 x 50L

 

Not worked out how to do it, I can of course use the wildcard option to find all (digit)x but can't replace them in that way as the digit varies. Thanks.

TOPICS
Type
312
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 20, 2023 Oct 20, 2023

Hi @defaults2aq0czkx4gl you write: Find/Replace to add a space after a an x but your example seems that you want a space before the x.

Find what: (?<=\d)x

Replace: ~Sx

 

Please note that I advise you to use a nonbreaking (~S) space instead of a “regular” space (\s)

Translate
Community Expert ,
Oct 20, 2023 Oct 20, 2023

Hi @defaults2aq0czkx4gl you write: Find/Replace to add a space after a an x but your example seems that you want a space before the x.

Find what: (?<=\d)x

Replace: ~Sx

 

Please note that I advise you to use a nonbreaking (~S) space instead of a “regular” space (\s)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 20, 2023 Oct 20, 2023
LATEST

Perfect, thanks very much. Yes sorry, I meant a space before the x.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines