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
How to search for multiple semicolon on one line ?
Moderators: AmigoJack, bbadmin, helios, MudGuard
-
Sergeant999
- Posts: 1
- Joined: Mon May 31, 2010 12:25 pm
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.
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.