Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Regex to match non image urls (Parse::BBCode)

by Anonymous Monk
on Jan 18, 2013 at 10:01 UTC ( #1014009=note: print w/replies, xml ) Need Help??


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
$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"; } }
But you should use Parse::BBCode

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
    Could't get that to work, it just says everything is invalid.
      Ah ha it was missing brackets on the tag parts. Works great now, thanks :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014009]
help
Chatterbox?
[LanX]: no try again
[choroba]: Didn't you forget to add a title? Did you include links to the post?
[LanX]: choroba IIRC these errors are indicated
[1nickt]: Missing title suppresses the submit button, I think.
[1nickt]: Petroza to answer your question, no, no special permission is needed to post a question.
[LanX]: did you spam before? :)
LanX has to go/
[ambrus]: I hope we didn't mess up the spam filter rules again.
[ambrus]: Our spam filter rules disallow links to certain domains, and some suspicious pharses that have appeared in previous spam advertising cheap online whatevers.
[LanX]: some servers were lagging today, so I suppose the root cause

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-10-17 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (233 votes). Check out past polls.

    Notices?