bugGNU Parallel - build and execute command lines from standard input in parallel - Bugs: bug #50505, regexp in replacement string

 
 

bug #50505: regexp in replacement string

Submitted by:  Ole Tange <tange>
Submitted on:  Thu 09 Mar 2017 09:28:39 PM UTC  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Ole Tange <tange>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 21 Mar 2017 11:16:20 PM UTC, comment #1:

Fixed in [2724941].

Ole Tange <tange>
Project AdministratorIn charge of this item.
Thu 09 Mar 2017 09:28:39 PM UTC, original submission:

Have a way of giving arguments to a --rpl:

--rpl '{%(.*?)} s/$1//'

--rpl '{%%(.*)} s/$1//'

{%.tar.gz} = remove .tar.gz

${parameter%word}
${parameter%%word}
Remove matching suffix pattern. The word is expanded to produce a pattern
just as in pathname expansion. If the pattern matches a trailing portion of
the expanded value of parameter, then the result of the expansion is the
expanded value of parameter with the shortest matching pattern (the ``%''
case) or the longest matching pattern (the ``%%'' case) deleted.

Multiple capture groups

perl -pe '/(\d)-(\d)/; $diff=$1-$2; {s/(\Q$1\E)/first$1/;} s/$2/diff=$diff/'

--rps '{%(\d)-(\d)} $diff=$1-$2; {s/(\Q$1\E)/first$1/;} s/$2/diff=$diff/1'

Ole Tange <tange>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tange (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Mar 2017 11:16:20 PM UTCtangeStatusNone=>Fixed
      Assigned toNone=>tange
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1