javascript - Getting Regex to work with custom Dreamweaver commands -


I have a large routine document that needs to be searched / replaced by many regular expression searches. To give, I focused on writing a Dreamweaver command to convert all of my searches into one shock (referenced :).

This is what I really want, so I'm starting to use the example and so far it's doing a great job for some people, however, my Reggae is being replaced / replaced Is being ignored. The document is very short on custom Dreamweaver commands and I can not find any well-used cases. I have tried to add / remove quotation / forward slash around the expressions, but there is no luck either.

My Reggae commands do a normal search / replace, but it is no longer a file that is in a javascript. Is Javascript W / Regex my use correct? Does anyone have anything like this to work on any fate?

  function canAcceptCommand () {true; } Function command buttons () {new arrays ("go!", "DoIt ()", "cancel", "window.close ()"); } Function doIt () {var categoriesTag = / & lt; \ / ([A-Z] {2})> ([^ \ r]) & lt; \ 1> / G; Dreamweaver.setUpFindReplace ({searchString: categoryTag, string: blank, search: what changes: "document", search source: true, match cas: true, regular expression: true}); Dreamweaver.replaceAll (); Dreamweaver.setUpFindReplace ({searchString: "&", string string: "& amp;", search: what: "document", search source: true, use customer expressions: true}); Dreamweaver.replaceAll (); Var inlineRM = / (RMSSE) / G; Var dropRM = / \ n $ 1 /; Dreamweaver.setUpFindReplace ({searchString: InlineRM, String: DropRM, Search: What: "Document", Search Source: True, Match Cas: True, Usual Expression: True}); Dreamweaver.replaceAll (); Var incorrect amphim format = / AM (SS-SSA) (. **) PM / G; Var correct ammp format = / ama Dreamweaver.setUpFindReplace ({searchString: incorrectAmPmFormat, replaceString: correctAmPmFormat, searchWhat: "document", search source: true, use cartoon expressions: true}); Dreamweaver.replaceAll (); Dreamweaver.setUpFindReplace ({searchString: ": 00", replaces string: "", search: what: "document", search source: true, usable expressions: true}); Dreamweaver.replaceAll (); Dreamweaver.setUpFindReplace ({searchstring: "fee help:", string: "\ n" fee help: ", search: what:" document ", search source: true, regular expression: true}); Dreamweaver.replaceAll (); Var removeBothPMs = / ss PM (SS-SS) (. **) PM / G; The preferred replacement is open PM = $ 1 / $ 2 PM /; Dreamweaver.setUpFindReplace ({searchString: removeBothPMs, replaceString: replaceWithOnePM, search: what: "document", search source: true, match cas: true, userx expression: true}); Dreamweaver.replaceAll (); Var removeBothAMs = / s SAM (SS-SSA) (. **) SM / G; With ON instead of Var = $ 1 $ 2a.m. /; Dreamweaver.setUpFindReplace ({searchString: removeBothAMs, replaceString: replaceWithOneAM, Search: What: "Document", Search Source: True, Match Cas: True, Usual Expression: True}); Dreamweaver.replaceAll (); Var three spaces = / \ s \ s \ s & lt; Image href = "file: \ / \ / \ section / communication / property \ / new app." & Gt; & Lt; \ / Image & gt; /; Dreamweaver.setUpFindReplace ({searchstring: " New ", location string: threespace, search: what: "document", search source: true, match cas: true, Use Regular Expression: True}}; Dreamweaver.replaceAll (); Dreamweaver.setUpFindReplace ({searchString: "& gt; & lt;", replaceString: "& gt; \ n & lt;", search: what: "document", search source: true, use customer expressions: true} ); Dreamweaver.replaceAll (); Window.close (); }  

I really want to add more, but I do not want to invest a lot of time in it if it is not working perfectly.

Thanks.

So, I betrayed Dreamweaver. It was not necessary that I do it in any way (old Use should should die). For those who still search for a solution, I suggest taking a similar path. I've just written a ruby ​​script (thank you :) which is what I really want, but very beautifully. Dreamweaver will be crashed under the load of randomly executed commands.


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -