Posts

Showing posts from February, 2010

ssh delays

So, delays ssh'ing into my dev box on LAN at home. Check this for probable Kerberos issues getting in the way: http://macnewbie.wordpress.com/2006/08/30/slow-ssh-connections-on-mac-os-x/ :)

Regex Lookahead/Positonal Assertions

Quick post that probably won't help if I try to remember how to do this. Large txt file (happens to be vCalendar), and needed to chop out whole heap of text to make it v1 compatible for my mobile phone... Anyhoo, a whole bunch of text between two strings had to come out whilst open in TextWrangler so this was the regex used: DTSTAMP:[\S\s]*?(?=SUMMARY) The first question mark after the "*" make the match 'non-greedy' then the (?=yourKeyWordHere) bit is a lookahead assertion. Along with lookbehind they're collectively called "lookaround" http://www.regular-expressions.info/lookaround.html