Forum Discussion
mazek_59373
Nimbostratus
Mar 02, 2009regexp
Hi,
I'm trying to match via a simple regexp an URI. It can be in a form of:
/sth/digits
/sth/digits.digit
/sth/digits_digit
example URI to be matched is: /aaaa/999.8
I would like to get only "999" of it. I'm trying to use regexp below:
set matched [regexp {([0-9]+)[\._]{0,1}[0-9]{0,1}$} $url id]
but id is still matched as a 999.8?
Regexp is quite simple, but maybe I misunderstand something. Any hints?
br
mazek
- hoolio
Cirrostratus
Hi Mazek,% regexp {[/\w]*/(\d+)[._\d]*} /letters/123456_789 unused id 1 % puts $id 123456 % regexp {[/\w]*/(\d+)[._\d]*} /letters/123456.789 unused id 1 % puts $id 123456 % regexp {[/\w]*/(\d+)[._\d]*} /letters/123456 unused id 1 % puts $id 123456 % regexp {[/\w]*/(\d+)[._\d]*} /123456 unused id
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects