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

Grep query with exceptions

Community Beginner ,
Jan 24, 2024 Jan 24, 2024

Copy link to clipboard

Copied

Hi, I need to find any 4 digit number except 2021, 2022 and 2023.
I'm sure ther is a way to do that with Grep but I can't figure out how.
Hope you can help me out.
/Kattis

TOPICS
How to , Scripting

Views

215

Translate

Translate

Report

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 2 Correct answers

Guide , Jan 25, 2024 Jan 25, 2024

(?!(2018|202[1-3]))\b\d{4}\b

 

(^/)

Votes

Translate

Translate
Community Expert , Jan 25, 2024 Jan 25, 2024

Hi @Katarina35022753lgi5 :

 

Is the somwhere I can find dummy-instruktions on how so write Grep-querys so I don't have to bother you with my simplest questions?

 

I think you will find this book to be very helpful:

https://www.amazon.com/GREP-InDesign-InDesignSecrets-Peter-Kahrel/dp/0982508387?nodl=1&dplnkId=f5bc7a37-6973-488e-8e1e-edd17cd3fc61

 

~Barb

Votes

Translate

Translate
Guide ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

(?!202[1-3])\b\d{4}\b

 

(^/)  The Jedi

Votes

Translate

Translate

Report

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 Beginner ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

Great!
But now I'm curious. How do I write if I also want to except 2018?
(I don't need that right now but I want to learn Grep syntax)
Is the somwhere I can find dummy-instruktions on how so write Grep-querys so I don't have to bother you with my simplest questions?
/Kattis

Votes

Translate

Translate

Report

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
Guide ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

(?!(2018|202[1-3]))\b\d{4}\b

 

(^/)

Votes

Translate

Translate

Report

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 ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

Hi @Katarina35022753lgi5 :

 

Is the somwhere I can find dummy-instruktions on how so write Grep-querys so I don't have to bother you with my simplest questions?

 

I think you will find this book to be very helpful:

https://www.amazon.com/GREP-InDesign-InDesignSecrets-Peter-Kahrel/dp/0982508387?nodl=1&dplnkId=f5bc7...

 

~Barb

Votes

Translate

Translate

Report

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 Beginner ,
Jan 26, 2024 Jan 26, 2024

Copy link to clipboard

Copied

LATEST

Thanks!
Both for the code en the great book tip, I will order it at once.

Votes

Translate

Translate

Report

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