SyntaxFix
Write A Post
Hire A Developer
Questions
Use the $ metacharacter to match the end of a string.
$
In Perl, this looks like:
my $str = 'red/white/blue'; my($last_match) = $str =~ m/.*\/(.*)$/;
Written in JavaScript, this looks like:
var str = 'red/white/blue'.match(/.*\/(.*)$/);