How to search for multiple semicolon on one line ?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Sergeant999
Posts: 1
Joined: Mon May 31, 2010 12:25 pm

How to search for multiple semicolon on one line ?

Post by Sergeant999 »

Hello,

how I do search for a line wchich contains 2 or more semicolon ?

I want to find all C sourcrcode lines which contain more than one C command, for example:

a=0: b=0;
X=e+i ; u = 3/x ; Z=x*x;

Many thanks for any hint!

Regards
Sergeant999
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

;.*;
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

this will also find some lines which only contain one C statement:

a = "x;y"; //only one statement
a = 1; //there's a ; at the end!

and it will also not find some lines which contain more than one statement:

if (x < 0) x = 2; //if statement and assignment statement

it is extremely difficult to have a correct result with a regex. There are so many special cases like Strings, characters, comments ...
Even with a full-featured regex engine it would be difficult, with Textpad's old engine it is probably impossible.

So I can't provide a better solution but still wanted to warn that the given solution has some shortcomings.
Post Reply