Hi the below perl snippet will replace any three letter string in the beginning with a two letter string which is specified..but if i want to modfiy only certain characters for eg..
ABC - AB
CAB - AB
AAA - No Modifcations
1AB - AB
AB8 - AB
Whatever coming before or after of AB only have to be deleted whereas the strings may be left as it is..
Perl Snippet
Thanks Guys!!!!!
Just for additional info guys how to specify spaces in the regex for eg i need to change AB B to AB how the regex to be modified .Thanks for the help guys!!!!!!
Hi,
Can anyone help me to find regular expression for the following in Perl?
"The string can only contain lower case letters (a-z) and no more than one of any letter."
For example: "table" is accepted, whether "dude" is not.
I have coded like this:
$str = "table";
if ($str =~ m/\b()\b/) {... (4 Replies)
I have got numbers like
l255677
l376039
l188144
l340482
l440700
l254113
to match the numbers starting with '13' what would be the regex
=~/13(.*)/ =======>This is not working ....
But for user123,user657
regex =~/user(.*)/ ========>works
Thanks for help..!! (7 Replies)
Hi there
I am trying to write an if statement in perl that will return "SUCCESS" if either of these conditions are true
a) if $changes is greater than 5 AND the $force flag is set to 1
OR
b) if $changes is greater than 0 AND $changes is less than 6
#!/usr/bin/perl -w
my $force =... (5 Replies)
I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly:
if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
First of all, please have mercy on me. I am not a noob to programming, but I am about as noob as you can get with regex. That being said, I have a problem.
I've got a string that looks something like this:
Publication - Bob M. Jones, Tony X. Stark, and Fred D. Man, \"Really Awesome Article... (1 Reply)
HI,
I'm new to perl and need simple regex for reading a file using my perl script.
The text file reads as -
filename=/pot/uio/current/myremificates.txt
certificates=/pot/uio/current/userdir/conf/user/gamma/settings/security/... (3 Replies)
Hi Guys
I have the following regex
$OSRELEASE = $1 if ($output =~ /(Mac OS X (Server )?10.\d)/);
output is currently
Mac OS X 10.7.5
when the introduction of Mac 10.8 output changes to
OS X 10.8.2
they have dropped the Mac bit so i changed the regex to be (2 Replies)
I am not a big expert in regex and have just little understanding of that language.
Could you help me to understand the regular Perl expression:
^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{
------
This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Experts -
I found a script on one of the servers that I work on and I need help understanding
one of the lines.
I know what the script does, but I'm having a hard time understanding the grouping.
Can someone help me with this?
Here's the script...
#!/usr/bin/perl
use strict;
use... (2 Replies)
Hi,
I need some guidance with understanding this Perl script below. I am not the author of the script and the author has not leave any documentation. I supposed it is meant to be 'easy' if you're a Perl or regex guru. I am having problem understanding what regex to use :confused: The script does... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT DEBIAN
padre::plugin::snippet
Padre::Plugin::Snippet(3pm) User Contributed Perl Documentation Padre::Plugin::Snippet(3pm)NAME
Padre::Plugin::Snippet - TextMate-like snippets for Padre
SYNOPSIS
cpan Padre::Plugin::Snippet
Then use it via Padre, The Perl IDE.
DESCRIPTION
Once you enable this Plugin under Padre, you'll get TextMate-style TAB triggered snippets for the following:
Perl
Moose
Mouse
MooseX::Declare
Example
For those who don't who this Text mate bloke is, just try to type in Padre something like:
for<tab>
if<tab>
ife<tab>
cfor<tab>
While editing the generated construct, you can type again <TAB>. Your cursor will be moved to the next point needing some attention in the
generated construct.
You can check the available keyword in the yaml files (perl.yml...) shipped with this module.
BUGS
Please report any bugs or feature requests to "bug-padre-plugin-snippet at rt.cpan.org", or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Padre-Plugin-Snippet <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Padre-Plugin-Snippet>.
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Padre::Plugin::Snippet
You can also look for information at:
o RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Padre-Plugin-Snippet <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Padre-Plugin-Snippet>
o AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Padre-Plugin-Snippet <http://annocpan.org/dist/Padre-Plugin-Snippet>
o CPAN Ratings
http://cpanratings.perl.org/d/Padre-Plugin-Snippet <http://cpanratings.perl.org/d/Padre-Plugin-Snippet>
o Search CPAN
http://search.cpan.org/dist/Padre-Plugin-Snippet/ <http://search.cpan.org/dist/Padre-Plugin-Snippet/>
SEE ALSO
Padre
AUTHORS
Ahmad M. Zawawi <ahmad.zawawi@gmail.com>
CONTRIBUTORS
Adam Kennedy <adamk@cpan.org>
Kevin Dawson <bowtie@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ahmad M. Zawawi
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-03-27 Padre::Plugin::Snippet(3pm)