Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^4: Eugh, regex :(

by ultranerds (Hermit)
on Mar 25, 2009 at 09:46 UTC ( #753074=note: print w/replies, xml ) Need Help??

in reply to Re^3: Eugh, regex :(
in thread Eugh, regex :(

Oops, just saw that! Changed it, still getting errors :(

It seems to be from this line still, cos if I comment it out - the rest of the script works fine:

$post_message =~ s|\Q[img]\E([\?\%\:\/a-zA-Z0-9_\-\.]+)\Q[/img]\E|[img]$1[/img]|sig;
(the above is just a more basic version of what I'm trying, to see if I can try and track down whats going on)

Driving me nuts :(



Replies are listed 'Best First'.
Re^5: Eugh, regex :(
by haoess (Curate) on Mar 25, 2009 at 09:58 UTC

    Ah, looks like you've stumbled into a perl parsing trap:


    This code tries to interpolate the @1 array, the index starts with a slash, parsed as the begin of a matching pattern, but missing the closing slash, that's why you get the Search pattern not terminated error. Escaping the [ with a backslash should make all things fine.

    -- Frank

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://753074]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2020-07-07 08:49 GMT
Find Nodes?
    Voting Booth?

    No recent polls found