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

Price Grep Style

New Here ,
Dec 06, 2018 Dec 06, 2018

So far I have this grep style, that allows the digits after the decimal to change to a different character style.

Screenshot 2018-12-06 at 10.23.12.png

Screenshot 2018-12-06 at 10.26.00.png

However, I need the decimal place to also be in the same style (see below)

Screenshot 2018-12-06 at 10.24.26.png

Does anyone have any tips/ideas how I could achieve this?

555
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 , Dec 06, 2018 Dec 06, 2018

When you use a positive lookbehind as you are, it won't affect the characters that you're looking for although it does help to avoid inadvertently formatting elements. jmlevy's suggestion should work, but I'd still to the positive loosbehind for a digit so that it only finds the period followed by two digits when it comes after another digit. Try the below expression because I don't think you'll ever have more than two digits after the period no?

(?<=\d)\.\d{2}

Translate
Community Expert ,
Dec 06, 2018 Dec 06, 2018

Did you try this?

\.\d+

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
Community Expert ,
Dec 06, 2018 Dec 06, 2018
LATEST

When you use a positive lookbehind as you are, it won't affect the characters that you're looking for although it does help to avoid inadvertently formatting elements. jmlevy's suggestion should work, but I'd still to the positive loosbehind for a digit so that it only finds the period followed by two digits when it comes after another digit. Try the below expression because I don't think you'll ever have more than two digits after the period no?

(?<=\d)\.\d{2}

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