Jejad
Jejad

Reputation: 289

Searching in strings with special character using regular expressions

I'm using regular expression to search word in a string, for example

var patrn:RegExp = new RegExp("\\bit's\\b");
var str:String = "Heres my problem in it and it's so help me guys.";
trace(patrn.exec(str)); //result is null

My problem is I can't search the data in a string which has special character like ('/,/.). What regular expression string is capable solving my problem?

Upvotes: 1

Views: 754

Answers (1)

bug-a-lot
bug-a-lot

Reputation: 2454

When dealing with regular expressions I always use http://www.gskinner.com/RegExr/ .

Upvotes: 1

Related Questions