Highlighted

Dreamweaver Regex Find & Replace help.

Community Beginner ,
Oct 23, 2019

Copy link to clipboard

Copied

I'm new at GREP & Regular Expressions (regex). I've searched here and found what I thought was a solution but I can't get it to do what I want it to. Basically, Using "Find and Replace in Files" I need to find all URL links in a set of files and modify/replace all the  code before and after the URL, but leave the URL intact.

 

I want to replace the code colored red:

<a href="https://www.myfancywebsite.com">

 

With this:

<a href="#" onclick="cordova.InAppBrowser.open ('https://www.myfancywebsite.com', '_system', 'location=yes');">

 

I tried doing this by creating a subexpression with wildcard character set but it didn't work. Clearly I'm not getting this at all...

I tried using this as the search: 
<a href="https://([.+\b])">  

And this as the replace:

<a href="#" onclick="cordova.InAppBrowser.open ('https://([.+\b])', '_system', 'location=yes');">

 

Is this even possible? Any help would be reallly appreciated.

 

Thanks,

Steve

 

 

Views

41

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Dreamweaver Regex Find & Replace help.

Community Beginner ,
Oct 23, 2019

Copy link to clipboard

Copied

I'm new at GREP & Regular Expressions (regex). I've searched here and found what I thought was a solution but I can't get it to do what I want it to. Basically, Using "Find and Replace in Files" I need to find all URL links in a set of files and modify/replace all the  code before and after the URL, but leave the URL intact.

 

I want to replace the code colored red:

<a href="https://www.myfancywebsite.com">

 

With this:

<a href="#" onclick="cordova.InAppBrowser.open ('https://www.myfancywebsite.com', '_system', 'location=yes');">

 

I tried doing this by creating a subexpression with wildcard character set but it didn't work. Clearly I'm not getting this at all...

I tried using this as the search: 
<a href="https://([.+\b])">  

And this as the replace:

<a href="#" onclick="cordova.InAppBrowser.open ('https://([.+\b])', '_system', 'location=yes');">

 

Is this even possible? Any help would be reallly appreciated.

 

Thanks,

Steve

 

 

Views

42

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 23, 2019 0

Have something to add?

Join the conversation