No one ? Come n : )
Any nice tutorials or pointers ?
Hi,
I don't know exactly what you are looking for as far as your algorithm but
try this;
private function init()
{
var s:String = linkwww.mywebsite.com/link;
var p:RegExp = /link\b[^]*(.*?)\/link/gi;
s = s.replace(p,a href='$1' target='_blank'$1/a);
trace(s)
}
it traces;
a
That's exactly what I needed!
How do you call the $1 technique?
Groups ?
Thanks Mike !
haha
and for the answer to your question after I read it again.
The technique is called '*replacement codes* '.
Peace, Mike
On 1/23/07, Michael Schmalle [EMAIL PROTECTED] wrote:
Hi,
for example;
var p:RegExp = /link\b[^]*(.*?)\/link/gi;
(.*?) is group $1
OR
var p:RegExp =
Hi,
for example;
var p:RegExp = /link\b[^]*(.*?)\/link/gi;
(.*?) is group $1
OR
var p:RegExp = /([link])\b[^]*(.*?)\/([link])/gi;
$1 ([link])
$2 (.*?)
$3 ([link])
In the order the groups are processed.
String.replace() uses them. Check the docs for more info on groups.
Peace, Mike
On
Tnx Mike for the insight! Really helpfull information.
Reg exps are very handy, but difficult to grasp in the beginning.
Cheers ; )
yeah, ;-)
It's another language to learn. A bit more on the symbolic side than
programming but all the same. Another lexical structure.
BTW, I know for a fact reg exp in as3/flash player 9 is supa dupa fast.
Peace, Mike
On 1/23/07, Webdevotion [EMAIL PROTECTED] wrote:
Tnx Mike for the
Hello,
Using reg exps I want to replace text enclosed in link/link tags with a
href=... tags.
var p:RegExp = /link\b[^]*(.*?)\/link/gi;
// the replace() replaces al link.../link occurences with a
href=googlegoogle/a
s = s.replace(p,a href='http://www.google.be' target='_blank'
www.google.be/a);
8 matches
Mail list logo