View Single Post
Old 04-07-2008, 03:46 AM   #12 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by delayedinsanity View Post
"\t" is the special character for tabs, so you could do something like

/\t+?(.*)/

perhaps, or if it's a specific amount of whitespace, such as 4 spaces, maybe

/\s{4}(.*)/

etc... does this help at all? The (.*) would be replaced with whatever else you're attemping to match, of course.
-m

Well its the problem of a persons indentation, I've been wanting ot make a syntax highlighter, but if someone has sloppy indentation, I can't do a successful pattern replacement, it just turns black v_v.

Unless, I do separate pattern matches for each set of keywords for syntax like "if condition then else", well I could chunk it out for pattern matching :D
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote