Sponsored Content
Full Discussion: RegExp - settle a bet
Top Forums UNIX for Dummies Questions & Answers RegExp - settle a bet Post 302186490 by gkalangi on Thursday 17th of April 2008 10:53:29 AM
Old 04-17-2008
Quote:
Originally Posted by earnstaf
A couple co-workers have a disagreement. Can you guys please settle this?

One co-worker says regular expressions can inherently search and replace. His argument is that he can do a s/ regexp / replace in perl (and many other languages).

The other says that by definition regular expressions is just pattern matching and that is an outside function doing the replacing.

Thoughts?
Regular Expressions are just patterns...They do not perform any functions...It is the commands like sed or tr that we use along with the regular expression performs the functions like substitute/translate the pattern matched.

Its just my thought!
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

No 5 fail. When install Patches. How to settle?

Install 2.6Recommanded on 2 workstations, one works, but the other one has many No 5 fail. the log says: Installing 106361-14... WARNING: /usr/sbin/patchadd is being used to install this patch. Checking installed packages and patches... Executing prepatch script... Verifying... (1 Reply)
Discussion started by: cloudsmell
1 Replies

2. News, Links, Events and Announcements

Microsoft and Sun Settle Litigation

http://www.microsoft.com/presspass/press/2004/apr04/04-02SunAgreementPR.asp no comments sad pressy (1 Reply)
Discussion started by: pressy
1 Replies

3. Programming

how to run prog bet to break points

Hi, I have set two break points at 500 and 572 lines respectively. after running prog using (gdb) run i m on the line 500 but how two go to second breakpoints ie line 572 . when i m giving (gdb) run it is asking again to run from starting lines . (1 Reply)
Discussion started by: useless79
1 Replies

4. Shell Programming and Scripting

script to read a line with spaces bet " " and write to a file

Hi, I need a command in UNIX KSH below is the description... MAPPING DESCRIPTION ="Test Mapping for the calid inputs" ISVALID ="YES" NAME ="m_test_xml" OBJECTVERSION ="1" VERSIONNUMBER ="1" unix ksh command to read the DESCRIPTION and write to a file Test Mapping for the calid inputs... (3 Replies)
Discussion started by: perlamohan
3 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

Find diff bet 2 files and store result in another file

Hi I want to compare 2 files. The files have the same amount of rows and columns. So each line must be compare against the other and if one differs from the other, the result of both must be stored in a seperate file. I am doing this in awk. Here is my file1: Blocks... (2 Replies)
Discussion started by: ladyAnne
2 Replies
PPI::Token::Regexp::Match(3)				User Contributed Perl Documentation			      PPI::Token::Regexp::Match(3)

NAME
PPI::Token::Regexp::Match - A standard pattern match regex INHERITANCE
PPI::Token::Regexp::Match isa PPI::Token::Regexp isa PPI::Token isa PPI::Element SYNOPSIS
$text =~ m/match regexp/; $text =~ /match regexp/; DESCRIPTION
A "PPI::Token::Regexp::Match" object represents a single match regular expression. Just to be doubly clear, here are things that are and aren't considered a match regexp. # Is a match regexp /This is a match regexp/; m/Old McDonald had a farm/eieio; # These are NOT match regexp qr/This is a regexp quote-like operator/; s/This is a/replace regexp/; METHODS
There are no methods available for "PPI::Token::Regexp::Match" beyond those provided by the parent PPI::Token::Regexp, PPI::Token and PPI::Element classes. Got any ideas for methods? Submit a report to rt.cpan.org! SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2001 - 2011 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.18.2 2011-02-25 PPI::Token::Regexp::Match(3)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy