Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

regex to select specific word

I am trying to write regex in notepad++ to only select a specific word DATE and not select any combination of words having DATE e.g. UPDATE, CONSOLIDATE or words with prefix with underscore or any other combination.

CREATE TABLE PERSON (
FIRST_NAME VARCHAR2;
LAST_NAME VARCHAR2;
INSERT_DATE DATE;
UPDATE_TIME DATE;
LASTEUPDATED DATE;
CONSOLIDATE DATE;
CHECKED_DATE DATE;
);

I used this pattern (UPDATE) but it gets UPDATE_TIME as well.

The result should look something like this:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

DATE
DATE
DATE
DATE
DATE

Any suggestions or thoughts?

>Solution :

You may place word boundaries \b around DATE to only match it as a standalone word:

Find:    \bDATE\b
Replace: DATETIME
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading