If you really want to use a regular expression for this, it would be something like /^.*?=(.*)$/. After that regex, $1 would hold your ID.
A regular expression isn't the right tool for that. Regular expressions can be expensive in terms of efficiency. So, you should favor other methods when possible.
For those strings use split ...
use strict; use warnings; my @strings = ( "http://mysite/bbsui.jsp?id=dxpwd", "http://mysite/bbsui.jsp?id=dxpsf", "http://mysite/bbsui.jsp?id=sfpwd", "http://mysite/bbsui.jsp?id=ds35e", "http://mysite/bbsui.jsp?id=124536" ); for ( @strings ) { my ($base, $id) = split( /=/, $_, 2 ); print "Id: $id\n"; }
-- -- GhodmodeBlessed is he who has found his work; let him ask no other blessedness.
In reply to Re: i wann get some character from a string
by GhodMode
in thread i wann get some character from a string
by weihe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |