cioperl has asked for the wisdom of the Perl Monks concerning the following question:
XXX="/blah1/blah2/blah3/1234567890;arg=AAA123BBB456CCC" # alphanumeric: ^^^^^^^^^^ # optional: ^^^^^^^^^^^^^^^^^^^^ # fixed string: ^^^^^ # alphanumeric: ^^^^^^^^^^^^^^^ echo "$XXX" | perl -n -e 'if (m[^/.+/([^/\?\s]+)(?:;arg=)?]) {print "$ +1\n";}'
echo "$XXX" | perl -n -e 'if (m[^/.+/([^/\?\s;]+)(?:;arg=)?]) {print " +$1\n";}' ^
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching substring in url
by choroba (Cardinal) on Nov 08, 2019 at 19:22 UTC | |
by cioperl (Novice) on Nov 08, 2019 at 19:37 UTC | |
|
Re: matching substring in url
by haukex (Archbishop) on Nov 08, 2019 at 19:24 UTC | |
by cioperl (Novice) on Nov 08, 2019 at 19:39 UTC | |
|
Re: matching substring in url
by roboticus (Chancellor) on Nov 09, 2019 at 19:11 UTC | |
|
Re: matching substring in url
by jcb (Parson) on Nov 09, 2019 at 00:50 UTC | |
by cioperl (Novice) on Nov 09, 2019 at 02:21 UTC | |
|
Re: matching substring in url
by hippo (Archbishop) on Nov 08, 2019 at 18:23 UTC | |
by cioperl (Novice) on Nov 08, 2019 at 18:45 UTC | |
by hippo (Archbishop) on Nov 08, 2019 at 22:15 UTC |