newLISP Fan Club

Forum => newLISP in the real world => Topic started by: Grundle on June 09, 2005, 09:46:05 AM

Title: regex variable pattern
Post by: Grundle on June 09, 2005, 09:46:05 AM
I was wondering if it is possible to use a variable for a pattern in a regex.  My code looks something like the following.



(set 'var1 (pop some-stack))

(if (find var1 var2 0)
     ;continue execution here
)


Obviously this doesn't work, but hopeful explains what I am trying to do.
Title:
Post by: Lutz on June 09, 2005, 10:50:51 AM
Yes, of  course this would work, just like you wrote it!



You can use variables anywhere in newLISP.



Lutz
Title:
Post by: Grundle on June 09, 2005, 11:42:22 AM
Yes you are right, and in fact I was doing the following.



(if (not (find (rest tag) s-tag 0))


The problem of course is that I put a quote before s-tag 's-tag

which of course will ruin everything.  It turns out to be something of an embarrassing oversite



:D