http://www.perlmonks.org?node_id=1004415


in reply to Question on Regex

Hello, perhaps this helps.

#!/usr/bin/perl use strict; use warnings; my $string = qq (.co.uk/Jobs/Company-Sector/C8A6446X4PND86M9WYJ/Tradew +ind/?APath=2.21.0.0.0); $string =~ m/.+\/.+\/.+\/(.+)\/.+/; print $1;

Update: I did not count right, sorry...

$string =~m/.+\/.+\/.+\/.+\/(.+)\/.+/;

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»