473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

need regular expression

hi i am new to perl, i have a doubt,
$var1=ab_domino_1.xml
i need the result when $var1 is printed as, ab_domino_thumb_1.jpg
could you suggest regular expression for it. kindly note the difference in the text and result needed.
Jul 13 '11 #1

✓ answered by Rabbit

Try: ab_domino(_[\w]+)?_1.[\w]{3}

2 1680
Rabbit
12,516 Expert Mod 8TB
Try: ab_domino(_[\w]+)?_1.[\w]{3}
Jul 13 '11 #2
miller
1,089 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. my $var1 = "ab_domino_1.xml";
  2.  
  3. $var1 =~ s/\.xml$/.jpg/;
  4.  
  5. print $var1;
  6.  
- Miller
Jul 13 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Danny | last post by:
I am trying to do a regular expression to search for a url so anything that has http:\\www.hellothere.com but may not have the http:\\ and may not have the www and may not have http:\\www and...
8
by: moondaddy | last post by:
I'm writing an app in vb.net 1.1 and I need to parse strings that look similar to the one below. All 5 rows will make up one string. I have a form where a use can copy/paste data like what you...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
3
by: Lee Grissom | last post by:
I want to parse the following string into 3 parts per match. I almost got it, but my expression has a flaw in it. I tried this, but didn't quite work the way I expect on the second match b/c...
2
by: comp.lang.php | last post by:
I am trying to replace within the HTML string $html the following: With Where I'm replacing "action=move_image" with "action=<?= $_REQUEST ?>"
6
by: billsahiker | last post by:
I cannot get anything to validate a comma delimited list of stock symbols, like "IBM, MSFT,INTC). symbols are alphanumeric with a maxium length of 5. I want to block multiple, adjacent commas, and...
2
by: billsahiker | last post by:
I am using the following to validate user input of a comma delimited list of stock symbols, separated by a comma and one or two spaces: ...
1
by: prasanthkarat | last post by:
What is the regular expression to match 6digits and optionally a character at the end followed by .abc? eg: 123456a.abc
0
by: AAaron123 | last post by:
Been playing with asp:changepassword and have it looking OK except that I can't elininate or change the title at the top that says "Change Your Password". It's a repeat of my pages title. ...
1
by: Lakhi | last post by:
I need regular expression for <a href="compose.php?to=user%40abc.com\" title=\"New Message to abc.user@abc.com\"> to replace with ""
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.