Skip to main content
Participating Frequently
July 6, 2011
Answered

Can we use the user input data as part of the regular expression ??

  • July 6, 2011
  • 1 reply
  • 453 views

Hello there !!

Yet another querry from me... This time want to know is it possible to use the user input string as part of reqular expression for instant search... I am aiming to add search feature in my game.. Where i m going to have several items available in list... what i am planning is to have a text box from which i will accept user input and perform instant search am still a noob in AS3... so whether using RegExp meet my goal ??

Any suggestions please...

Thanks in advance....

This topic has been closed for replies.
Correct answer Kenneth Kawamoto

Yes - you can construct regular expression like this:

new RegExp("bob", "gi");

1 reply

Kenneth Kawamoto
Community Expert
Kenneth KawamotoCommunity ExpertCorrect answer
Community Expert
July 7, 2011

Yes - you can construct regular expression like this:

new RegExp("bob", "gi");

Participating Frequently
July 20, 2011

Thanx Kenneth it worked... and sorry for late reply..

i used

var myreg:RegExp = new RegExp(mytextbox.text,"gi");

it did the job...

my next querry is...

can i get the information present in library pop-up of flash 4 some how to php script ??

Kenneth Kawamoto
Community Expert
Community Expert
July 20, 2011

Sorry I don't understand your question - can you elaborate? (I like the sound of "Flash 4" )