• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

A simple regular expression question

I need to replace:
have_url:XXXXXXXXXXXX:
with:
url_descript|XXXXXXXXXXXX|have_url|

where XXXXXXXXXX is some text i don't know in advance, I know there is some kind of method of using \1 in the end of the regular expression in order to store the replaced text but I havn't been able to use it.
Please reply ASAP
0
iddo_levin
Asked:
iddo_levin
  • 2
1 Solution
 
samayCommented:
s"(.*?):(.*?)"url_descript|$2|$1|"

0
 
maxkirCommented:
s#have_url|(.*):#url_descript|$1|have_url|#
0
 
maxkirCommented:
Sorry, misprinting:

s#have_url:(.*):#url_descript|$1|have_url|#
0
 
iddo_levinAuthor Commented:
10x
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now