in reply to Re^3: Regex to match non image urls
in thread Regex to match non image urls
You want to use Parse::BBCode, but you could try
But you should use Parse::BBCode$text =~ s{ \[(\w+)\] # $1 tagname ( .*? ) # $2 stuff \[\/(\w+)\] # $3 tagname }{ TagFudge( $1, $2, $3 ); }gsex; sub TagFudge { my( $open, $content, $close ) = @_; if( $content =~ m{\.(jpe?g|gif|xbm|png|bmp)$} ){ return "Ok"; } else { return "Invalid"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Regex to match non image urls (Parse::BBCode)
by userdefinable (Initiate) on Jan 18, 2013 at 10:11 UTC | |
by userdefinable (Initiate) on Jan 18, 2013 at 10:16 UTC |
In Section
Seekers of Perl Wisdom