regex search and replace for batch - Easily edit files!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: regex search and replace for batch - Easily edit files!

#46 Post by dbenham » 14 Nov 2014 15:51

JREPL.BAT (The successor to REPL.BAT) is now available at: viewtopic.php?f=3&t=6044


Dave Benham

morphinist
Posts: 1
Joined: 10 Feb 2015 05:22

Re: regex search and replace for batch - Easily edit files!

#47 Post by morphinist » 10 Feb 2015 05:55

Hi!
I try to replace erase a multiline-string from a XML-file:

<subsystem xmlns="urn:jboss:domain:jmx:1.1">
<show-model value="true"/>
<remoting-connector/>
</subsystem>

With this Command:

type "C:\Users\%USERNAME%\Desktop\standalone-mach_174.xml"|repl /M "(<subsystem xmlns=.*urn:jboss:domain:jmx:1.1.*>[\r\n]<show-model value=.*true.*/>[\r\n]<remoting-connector/>[\r\n]</subsystem>)" "" >standalone-mach_174.xml.new
move /y "standalone-mach_174.xml.new" "standalone-mach_174.xml" >nul

Can you help me?

viveklucky1848
Posts: 1
Joined: 23 May 2016 11:29

Re: regex search and replace for batch - Easily edit files!

#48 Post by viveklucky1848 » 23 May 2016 11:42

I am using Geany editor for various programming languages like PHP, Javascript etc.

Now I want to replace/remove certain text inside a Text block (selection of text) and not entire file.

I know Geany can pass currently selected text block to external commands through Context Menu > Format > Send selection to > Command.

How can I receive the currently selected text through stdin/stdout scenario and replace the text and send updated text block back to the file through stdout in Repl ?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: regex search and replace for batch - Easily edit files!

#49 Post by foxidrive » 24 May 2016 13:49

jrepl and repl can accept stdin and output to std out.

How does geany package the data?

Post Reply