Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^4: Unrecognized escape \Q passed through in regex

by Articuno (Beadle)
on Jan 26, 2006 at 19:13 UTC ( #525823=note: print w/replies, xml ) Need Help??

in reply to Re^3: Unrecognized escape \Q passed through in regex
in thread Unrecognized escape \Q passed through in regex

But what's wrong with what I suggested in my earlier post?

The regexes are in a DB. In the beginning, all of them where full regexes (no need for \Q...\E, etc...). But now, some of them are created by an user with a GUI. These "new" regexes are "plain text", and I want to ignore the metacharacters of *them* only, and not of all the regexes. If I "quotemeta" any regex i see, I can end up quoting real regexes :-(

Oh, and the interface is not in Perl, so I don't have quotemeta there. All I can do is surround with \Q...\E and hope it works, but as I found out (the bad way), it doesn't :-(
-- 6x9=42
  • Comment on Re^4: Unrecognized escape \Q passed through in regex

Replies are listed 'Best First'.
Re^5: Unrecognized escape \Q passed through in regex
by ikegami (Pope) on Jan 26, 2006 at 19:31 UTC
    quotemeta should be easy to implement in any language. Adding a slash in front of any characters other than [a-zA-Z0-9] should do the trick.
      Ok... You won :-)
      (somehow i was thinking that there could be a problem with that... but now it's clear that it's safe ^_^;;; )
      -- 6x9=42

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://525823]
[Cosmic37]: I read that its possible to use the FANN library with Perl so I might try that now...
[corenth]: i have a question. I used map{ blah();blah(); blah();}@stuff; and it used up a ton of memory vs. the for(@stuff){} equivalent. What gives? (if anyone knows)
[Cosmic37]: FANN also has LGPL license which I like and its supposed to be quite a capable library from what I read
[corenth]: Cosmic, that sounds interesting. What is FANN (I could search it if I weren't so lazy about it)?
[Cosmic37]: how big was @stuff corenth?
[Cosmic37]: Fast Artificial Neural Network (FANN) is cross-platform open source programming library for developing multilayer feedforward Artificial Neural Networks
[corenth]: @stuff was pretty big. I think it grew to about 8000.

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2018-02-20 18:17 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (274 votes). Check out past polls.