<?xml version="1.0" encoding="windows-1252"?>
<node id="1014009" title="Re^4: Regex to match non image urls (Parse::BBCode)" created="2013-01-18 05:01:27" updated="2013-01-18 05:01:27">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
You want to use [mod://Parse::BBCode], but you could try  &lt;c&gt;
$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";
    }
}
&lt;/c&gt;
But you should use Parse::BBCode</field>
<field name="root_node">
1013989</field>
<field name="parent_node">
1013998</field>
<field name="reputation">
11</field>
</data>
</node>
