Sponsored Content
Full Discussion: vi + regexp + substitute
Top Forums UNIX for Dummies Questions & Answers vi + regexp + substitute Post 59137 by Lomic on Friday 10th of December 2004 09:10:49 AM
Old 12-10-2004
Quote:
Originally posted by zazzybob
you can supress the interpretation of metacharacters by backslash escaping them...

e.g.
Code:
:%s/^.*my_patter_has_special_chars\*\/\$\^_in_it.*$//

As you can see, the .* at the beginning and end of line are still treated as metacharacters (as are the anchors).
ok but my_pattern_has_special_chars looks like
Code:
blabla 'toto' rep:/titi/toto/

so I protect it between #

if I understand what you mean, I should do like this:
Code:
:%s/^.*blabla\ \'toto\'\ rep\:\/titi\/toto\///

Am I right? (if it is the case, it si ok because my pattern never change)
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

regexp

Hi guys, does anyone know how to test for a regular expression - i want to include it in a script to make sure the variable is a regexp cheers (1 Reply)
Discussion started by: penfold
1 Replies

2. Shell Programming and Scripting

perl regexp

What is the easiest way to get full address of *.jpg images from html file using perl? example: http://farm3.static.flickr.com/2397/2126443111_65a810004c.jpg (1 Reply)
Discussion started by: mirusnet
1 Replies

3. Shell Programming and Scripting

regexp help

I'd like to know if there is a catchall line for renaming the following patterns: s01e03 -> 01x03 s4e9 -> 04x09 s10e08 ->10x08 and possibly even: 318 -> 03x18 1002 ->10x02 if its the first 3 or first digit number in the string. thanks! (0 Replies)
Discussion started by: TinCanFury
0 Replies

4. Shell Programming and Scripting

Help with regexp

Hi there! I would like to know how to find and replace all numbers in a *.html file and make them bold. Any help will be appreciated! :) (7 Replies)
Discussion started by: agasamapetilon
7 Replies

5. UNIX for Dummies Questions & Answers

print the line immediately after a regexp; but regexp is a sentence

Good Day, Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp. sed -n '/regexp/{n;p;}' filename What if my regexp is 3 word or a sentence. Im... (3 Replies)
Discussion started by: ownins
3 Replies

6. Shell Programming and Scripting

How to do equivalent of /(regexp){0}/ ?

I don't want to have to resort to /()/ though that does work. Effectively, I need to be able to implement /(?:(?:regexp1){0})(regexp2)\D/ to basically match regexp2 as long as it is present and regexp1 is NOT. So, how to do /(regexp){0}/ ? (2 Replies)
Discussion started by: Vi-Curious
2 Replies

7. Shell Programming and Scripting

Need help with sed and regexp

Hi everyone, I would really appreciate any help I could get on the following topic. I am not very familiar with reg expressions nor with sed, I just know the basic uses. What I am trying to do is the following: I have a huge text file where I would like to replace all occurnces of a certain... (13 Replies)
Discussion started by: Boxtuna
13 Replies

8. Shell Programming and Scripting

Regexp

I would like to extract "1333 Fairlane" given the below text. The word "Building:" is always present. The wording between Building and the beginning of the address can be almost anything. It appears the the hyphen is there most of the time. Campus: Fairlane Business Park Building:... (9 Replies)
Discussion started by: bbaker@copesan.
9 Replies

9. Shell Programming and Scripting

Gawk and regexp

Hello, This is a problem I've worked on a while and can't figure out. There is a file.txt ..some stuff.. ] ] ..some stuff.. The Awk program is trying to extract the year portion of the birth and death ("98: and "2nd C.") using the below technique #!/bin/awk @include... (5 Replies)
Discussion started by: Mid Ocean
5 Replies

10. What is on Your Mind?

A Regexp You Can Use Everywhere

¯\_(ツ)_/¯ bakunin (0 Replies)
Discussion started by: bakunin
0 Replies
truchet(6x)							XScreenSaver manual						       truchet(6x)

NAME
truchet - draws curved or angular Truchet patterns SYNOPSIS
truchet [-display host:display.screen] [-foreground color] [-background color] [-window] [-root] [-mono] [-install] [-visual visual] [-delay milliseconds] [-min-width integer] [-min-height integer] [-max-width integer] [-max-height integer] [-max-linewidth integer] [-min- linewidth integer] [-erase] [-no-erase] [-erase-count integer] [-square] [-not-square] [-curves] [-no-curves] [-angle] [-no-angles] [-scroll] [-scroll-overlap integer] [-anim-delay integer] [-anim-step-size integer] [-fps] DESCRIPTION
The truchet program draws arc and line based Truchet patterns. OPTIONS
truchet accepts the following options: -window Draw on a newly-created window. This is the default. -root Draw on the root window. -mono If on a color display, pretend we're on a monochrome display. -install Install a private colormap for the window. -visual visual Specify which visual to use. Legal values are the name of a visual class, or the id number (decimal or hex) of a specific visual. -delay milliseconds How long to wait between drawing each screenful. Default is 1 seconds. -min-width integer The minimum width in pixels of each square. Default is 40. -min-height integer The minimum height in pixels of each square. Default is 40. -max-width integer The maximum width in pixels of each square. Default is 150. -max-height integer The maximum height in pixels of each square. Default is 150. -max-linewidth integer The maximum width of the lines used to draw. Default is 25. -min-linewidth integer The minimum width of the lines used to draw. Default is 2. -erase -no-erase Whether to clear the screen after each screenful is drawn. Default is True (erase). -erase-count integer The number of screenfuls to draw before erasing. Default is 25. -square -not-square Whether to force the tiles to be square. Default is True (square). -curves -no-curves Whether to draw the arc based Truchet pattern. Default is True (curves). -angles -no-angles Whether or not to draw the line based Truchet pattern. Default is True (angles) -scroll Use the scroll mode. Default is False. -scroll-overlap The amount to scroll from one side to another. Default is 400. -anim-delay The time to pause between each animation step. Default is 100. -anim-step-size The amount of steps to skip between each animation step. Default is 3. -fps Display the current frame rate and CPU load. ENVIRONMENT
DISPLAY to get the default host and display number. XENVIRONMENT to get the name of a resource file that overrides the global resources stored in the RESOURCE_MANAGER property. SEE ALSO
X(1), xscreensaver(1) COPYRIGHT
Copyright (C) 1998 by Adrian Likins. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, pro- vided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in sup- porting documentation. AUTHOR
Adrian Likins, 1998. X Version 11 5.15 (28-Sep-2011) truchet(6x)
All times are GMT -4. The time now is 03:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy