Hey Guys,
I am trying to add “Newline” before and after beginning of every lesson.
Suppose Input is
[AS]var str:String = “Lesson 1 Jobmatching.” + "
" + “This is Job Matching Lesson text” + "
"+ “Do you know this.” + "
" +“Lesson 2 Basics of FlashDesign.” + "
" + “This is Basics of Flash Design Lesson Text”;
[/AS]
Now when you trace str, it will be this.
Lesson 1 Jobmatching.
This is Job Matching Lesson text
Do you know this.
Lesson 2 Basics of FlashDesign.
This is Basics of Flash Design Lesson Text
So i have already written a regular expression which matches this text
[AS]var pattern:RegExp = /Lesson+ ([0-9]+) ([a-z]+)*./[/AS]
Looks Correct…isn’t it.
Now I have tried “str.replace”…“str.match” etc but couldn’t get the desired output.
This is the output i am looking for:
Lesson 1 Jobmatching.
This is Job Matching Lesson text
Do you know this.
Lesson 2 Basics of FlashDesign.
This is Basics of Flash Design Lesson Text
So how can i achieve this.Any thoughts?
Thanks.