Wednesday, February 11, 2009

wildcard regex in notepad

The general wildcard regex for notepad (simliar to % in sql) is (.*).

So to match both of these lines:

</option><option value="COM">COMPAQ ALPHA UNIX
</option><option value="DGV">DATA GENERAL AOS/VS


The regex/search value looks like:

</option><option value="(.*)">

Just don't forget to toggle search mode to "regular expression"

2 comments:

Unknown said...

this is a problem though, when the delimiting characters appear more than once in the subject you are searching ... notepad++ doesn't support a non-greedy search ... instead specific what character you AREN'T searching for

as in:
http://stackoverflow.com/questions/3971052/notepad-non-greedy-regular-expressions

Unknown said...

for example, to search for

CHAR(3) in the subject CREATE TABLE ENTITY_ACAD_BLDG_TRANS ( ACAD_CODE CHAR(3) NOT NULL, BLDG_CODE CHAR(4), LOCATION VARCHAR2(64) NOT NULL, CONSTRAINT ENTITY_ACAD_BLDG_TRANS_PK PRIMARY KEY (ACAD_CODE) );

use this:
CHAR([^)]+)[)]