Regular expression help for newbie


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Regular expression help for newbie
# 1  
Old 05-18-2006
Regular expression help for newbie

Can someone tell me what these two expressions do?


$_[1] =~ s/\*/\.\*/;


$_[0] =~ m/($_[1])\s*$/i
# 2  
Old 05-19-2006
Can you put this in context? It looks like perl, but I'm not sure. It would also help to make sure this isn't a homework question...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sed: -e expression #1, char 0: no previous regular expression

Hello All, I'm trying to extract the lines between two consecutive elements of an array from a file. My array looks like: problem_arr=(PRS111 PRS213 PRS234) j=0 while } ] do k=`expr $j + 1` sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt ---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies

2. UNIX for Dummies Questions & Answers

Help with regular expression

Hi All, Need some help with a regular expression that I cant seem to work on. Say there is the following text - Input We all (need some) help some day (ps: when it rains) and I need to save some hay now. During the rainy season (ps: when it might rain heavily) Seattle gets drenched but not... (3 Replies)
Discussion started by: ManoharMa
3 Replies

3. Programming

Perl: How to read from a file, do regular expression and then replace the found regular expression

Hi all, How am I read a file, find the match regular expression and overwrite to the same files. open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat"; open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat"; while (<DESTINATION_FILE>) { # print... (1 Reply)
Discussion started by: jessy83
1 Replies

4. Shell Programming and Scripting

Hidden Characters in Regular Expression Matching Perl - Perl Newbie

I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense. ... (4 Replies)
Discussion started by: kittyluva2
4 Replies

5. Shell Programming and Scripting

Integer expression expected: with regular expression

CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error. source $CA_VERSION_DATA if * ] then echo "CA_RELESE $CA_RELEASE is invalid" exit -1 fi + source /etc/ncgl/ca_version_data ++ CA_PRODUCT_ID=samxts ++ CA_RELEASE=6 ++ CA_WEEK_NO=7 ++... (3 Replies)
Discussion started by: ketkee1985
3 Replies

6. Shell Programming and Scripting

regular expression (.*?)

hi all, i have a text file with below content ............................... ............................... ............................... ............................... %%Page: (4) 4 %%PageBoundingBox: 34 -30 584 831 %%BeginPageSetup %%BeginFeature: *PageSize A4 595 842... (7 Replies)
Discussion started by: uttamhoode
7 Replies

7. Shell Programming and Scripting

Regular expression

Hi I have to extract the first field and the last %field of the following out put.. /home (/abc/def/bhd ) : 522328 total allocated Kb 319448 free allocated Kb ... (2 Replies)
Discussion started by: Harikrishna
2 Replies

8. Linux

Regular expression to extract "y" from "abc/x.y.z" .... i need regular expression

Regular expression to extract "y" from "abc/x.y.z" (2 Replies)
Discussion started by: rag84dec
2 Replies

9. Shell Programming and Scripting

Regular Expression + Aritmetical Expression

Is it possible to combine a regular expression with a aritmetical expression? For example, taking a 8-numbers caracter sequece and casting each output of a grep, comparing to a constant. THX! (2 Replies)
Discussion started by: Z0mby
2 Replies
Login or Register to Ask a Question