mIRC Home    About    Download    Register    News    Help

Print Thread
#38295 25/07/03 09:24 PM
Joined: Dec 2002
Posts: 395
M
MonoSex Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
I'm trying to make a /filter exclude empty lines and the ones starting with ";" (comments), but also:

(space)(space)(...) ; comment
(tab)(tab)(...) ; comment

Any ideas? I don't know regex crazy.

#38296 25/07/03 09:46 PM
C
codemastr
codemastr
C
I think something like:
/filter -xg in.txt out.txt ^(;|((\t|\x20)*;)|$)
will do what you want.

Also a note, when you said like (space)(space)(...); and (tab)(tab)(...); I also assumed you meant things like (space)(tab)(tab)(space)(...); to be ignored too. That regex should ignore any line that starts with any combination of tabs and spaces followed by a ; as well as blank lines and lines that start with a ; hope thats what you wanted smile

#38297 25/07/03 10:03 PM
Joined: Dec 2002
Posts: 395
M
MonoSex Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
It works, thanks! laugh

#38298 27/07/03 01:01 PM
Joined: Dec 2002
Posts: 395
M
MonoSex Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
One more thing...
If i have a list like:

"blah1" "blah2" "blah3" (...)

How would i extract the values between ""?
So every one would be filled in $regml(N).

I tried something like /"(.*)"{1,}/ but it's obviously wrong shocked

#38299 27/07/03 02:21 PM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
/"([^"]*)"/g

What you were missing is the /g modifier.

#38300 27/07/03 02:30 PM
Joined: Dec 2002
Posts: 395
M
MonoSex Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
Thanks laugh


Link Copied to Clipboard