Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #10270

Re: search replace with regex

From Daniel Pitts <newsgroup.nospam@virtualinfinity.net>
Newsgroups comp.lang.java.programmer
Subject Re: search replace with regex
References <ajjuc752tol3mcbrnlmlup7l5a29aadnuu@4ax.com> <lVKzq.74340$SW4.56763@newsfe08.iad> <mi20d7dt3qgn4mbdahl3gt0dgo7lkr5f6f@4ax.com>
Message-ID <dzeAq.35609$t37.5110@newsfe14.iad> (permalink)
Date 2011-11-26 15:24 -0800

Show all headers | View raw


On 11/25/11 1:46 PM, Roedy Green wrote:
> On Fri, 25 Nov 2011 07:24:00 -0400, Arved Sandstrom
> <asandstrom3minus1@eastlink.ca>  wrote, quoted or indirectly quoted
> someone who said :
>
>>
>> On Windows I use Notepad++ or Powershell for the general case (where
>> it's _not_ source code in an IDE).
>
> For source code IntelliJ has Java regexes built into the IDE is a
> quite convenient way.  The problem mostly is scanning content for the
> website which is mostly HTML or embedded macros to do bulk changes.
IntelliJ has quite a nice HTML/XML editor as well, and its regex support 
works on those file types without any stretched imagination.
>
> For this I need something quite quick with the ability to handle
> multiple files and multiple regexes per pass.
Are you talking about from a command line? I tend to use "sed" for such 
tasks, but does not have Java syntax either.  Not sure why you would 
force it too.
>
> I will have a look for PowerShell.
>
> If I write my own, I will build in a regex proofreader than lets you
> see by colour which chars are being taken literally and which as
> commands. It could also make sure () [] balance etc.
The latest IntelliJ has a very nice regex editor.

>
> It has also dawned on me that XML is a quite reasonable language to
> define scripts.  You can create it with a gui.  You can play with in
> with XML tools safely. You can edit it externally. It already has a
> mechanisms for comments, handling awkward characters and treating
> multiple spaces as significant.  It is easy for others to generate
> with custom apps since they can avoid dealing with some of the messy
> details.

XML is quite a reasonable syntax for expressing trees. That doesn't make 
it a "good" language to define scripts.
    (a) It's not a language, but a markup syntax.
    (b) It's often too verbose for "scripts".
    (c) While it may seem nice to play/edit/inspect with existing tools,
        creating a tool which reads XML and performs commands is a bit
        of work.  Surprisingly not much less complicated than a real
        compiler/interpreter.
    (d) ant does exactly what I'm saying isn't a good idea ;-)


--
Daniel.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

search replace with regex Roedy Green <see_website@mindprod.com.invalid> - 2011-11-25 00:17 -0800
  Re: search replace with regex Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-11-25 07:24 -0400
    Re: search replace with regex Roedy Green <see_website@mindprod.com.invalid> - 2011-11-25 13:46 -0800
      Re: search replace with regex Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-11-26 15:24 -0800
      Re: search replace with regex bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-12-13 09:29 +0000
  Re: search replace with regex Arne Vajhøj <arne@vajhoej.dk> - 2011-11-25 17:09 -0500
    Re: search replace with regex JussiJ <jussij@zeusedit.com> - 2011-12-12 20:15 -0800
      Re: search replace with regex Lew <lewbloch@gmail.com> - 2011-12-13 07:55 -0800

csiph-web