Expect: gotchas

From FVue
Jump to: navigation, search

Match dot (.) in regexp

Why doesn't this match?

# output: '   .svn'
expect -re " +.svn"

Because it's a regular expression, stupid, and a dot (.) has a special meaning in a regular expression. The correct syntax is with the dot escaped:

expect -re " +\.svn"

Comments

blog comments powered by Disqus