I'd like to replace data of format (1:2:3) with a text like a.b.c/d.php?e=1_2_3 on forums webpage.
The regexp used could be something like this:
(?<LOCATION>(?<=\()\d+:\d+:\d+(?=\)))
Then the :'s needs to be replaced with _'s and the url prefix and suffix added. and the original match replaced with this new sting.
I have no knowledge of javascrip and i find it hard to code. If its trivial for someone to do this rather simple procedure id appriciate any help.
Javasript replace help
Moderator: General Moderators
-
Shendemiar
- Forum Contributor
- Posts: 404
- Joined: Thu Jan 08, 2004 8:28 am
In my pseudo-code it would be something like this:
Pseudocode:
Pseudocode:
Code: Select all
For each match do {
String = whole document
String.replace("/(?<LOCATION>(?<=\()\d+:\d+:\d+(?=\)))/", "[url]<LOCATION>[/url]").replace(":", "_")
}