Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I look up file name with specific characters

I have hundreds of text files with names like: D14 J4N4-BAPN_633nm_20x_100%_30accu_10s_point 1 and D14 J4N5-NOBAPN_633nm_20x_100%_30accu_10s_point 3 as shown in the picture below:

enter image description here

I would like to select files which name contain BAPN as a group and NOBAPN as another group. But BAPN and NOBAPN contain the same characters as BAPN. How can I achieve this?

like image 715
Fengting Ji Avatar asked Mar 09 '23 21:03

Fengting Ji


1 Answers

Simple regex aughta do what you're looking for:

(BAPN)|(NOBAPN)

can check it out here - regex101 BAPN

This will capture those exact strings as separate captures without overlapping.

like image 111
Nieminen Avatar answered Mar 16 '23 06:03

Nieminen