added classpath support
added lookahead regex and simplified slicing logic