regex


Regexp matching of “a*” in expect


I have following expect script:
#!/usr/bin/expect -f
spawn echo "aabab"
expect -re "a*" {
puts "<$expect_out(0,string)>"
}
Which outputs:
$ ./re.exp
spawn echo aabab
<>
I expected the regex to be greedy and match aa, but an empty string was matched instead.
Isn't expect's matching be greedy by default? How can I get my desired match of aa?
I am running expect-5.45-18.fc22.x86_64 from Fedora 22 (Debian 8.2 is the same).

Related Links

What is the meaning of the following awk script example?
Regular expression optional match start/end of line
preg_replace with UTF-8 letter
regex just have 2 items [closed]
Regular expression find and replace Notepad ++
regex wont find a match
Selective regex on a word/character
Why doesnt [\n$] work while (\n|$) does?
How to create an array of regex matches
Greedy and non-greedy regex
How can find and replace muiti text at once?
regex for float with 6 decimals and 3 numbers
regex invalid expression nothing to repeat
capture IP addresses only using R
What strings satisfy regex: (^$)|(^.*\{count\}.*$)
Regular Expression - Binary String Matches But Not When Reversed

Categories

HOME
performance
mocking
lsf
oozie
copy
word-vba
windows-runtime
visual-studio-2012
gluon
go-gorm
jbpm
mobilefirst-adapters
copy-paste
pymc3
oracle-ucm
openmodelica
chart.js2
union
cloudrail
gitlab-ci-runner
slime
dotnetbar
centroid
datamatrix
py4j
robotium
selenium-edgedriver
background-subtraction
shape
italic
confidence-interval
padding
intersystems
angular-services
parallax
unsigned-integer
code-signing
angular-ngmodel
masstransit
opensuse
python-behave
evercookie
vue-router
stackexchange.exceptional
capstone
querydsl
powerbuilder-conversion
perl-module
vue2
ipod-touch
linear
ulimit
permgen
qmenubar
couchbase-lite
maven-jetty-plugin
manifoldjs
multisite
gcc4.8
dump
ternary
node.js-tape
html-lists
master-data-management
facebook-canvas
graph-traversal
assembly-references
ipmi
cabal-install
post-increment
activity-diagram
python-3.1
oracle-policy-automation
mars
cucumber-java
multiple-files
php-opencloud
kinto
linqtocsv
uikeyboard
json4s
rdotnet
cbc-mode
easynetq
words
azimuth
ramdisk
location-client
re2c
emitmapper
qdebug
wow64
globbing
neventstore
wpf-4.0
arden-syntax
undeclared-identifier
facebook-authentication
retain
plinqo
geneva-framework

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App