jgingras Posted June 6, 2008 Posted June 6, 2008 (edited) I dont use javascript a ton so this might seem like a stupid question.. but im trying to pass a variable in a function.. >function repopDiv(searchstr) { if (searchstr == '') { popDiv('',EmailsArray); } else { popDiv(/^*searchstr here*/i,EmailsArray); } } searchstr is a string that needs to be examined in the regular expression checking.. but how do I do that? if I do /^searchstr/i, it will look for searchstr.. Not sure exactly how to wrap it.. Thanks everyone! Edited June 6, 2008 by jgingras Quote
jgingras Posted June 6, 2008 Author Posted June 6, 2008 Someone please help!! I dont know what I can do so that I can get this to work.. if you have experience with regular expressions but dont understand quite what im getting at, please let me know. I need to get this working today!!! Quote
TCH-Thomas Posted June 6, 2008 Posted June 6, 2008 I understand that you maybe are in a hurry and need to get this solved, but please do not bump the thread, if someone has an answer to your question he or she will post. Quote
jgingras Posted June 6, 2008 Author Posted June 6, 2008 Sorry about that... I just figured it out... var test = '^' + searchstr; popDiv(RegExp(test,'i'),EmailsArray); Thanks.. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.