Literal and wildcard replace

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
eezarfs
Posts: 2
Joined: Thu Aug 09, 2012 3:25 pm

Literal and wildcard replace

Post by eezarfs »

I'm a newbie...

I'm attempting to find literal text followed by varying text and need to know the reglar expression.

An example of the text to be replaced:

CAST(0x0000A0A100EE05FC AS DateTime)

where the 0x0000A0A100EE05FC is variable.


I want to replace the 'CAST(' to the closing parenthesis ')' with CURRENT_TIMESTAMP.


Any help is really appreciated.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post by ak47wong »

If you have POSIX regular expression syntax enabled in Configure > Preferences > Editor as is normally recommended:

Find what: CAST\([^ ]* AS DateTime\)
Replace with: CURRENT_TIMESTAMP

If you don't have POSIX regular expression syntax enabled:

Find what: CAST([^ ]* AS DateTime)
Replace with: CURRENT_TIMESTAMP
eezarfs
Posts: 2
Joined: Thu Aug 09, 2012 3:25 pm

Post by eezarfs »

Thanks, works perfectly.
Post Reply