![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl regexp | mirusnet | Shell Programming and Scripting | 1 | 04-04-2008 05:15 PM |
| lazy capture don't work (regexp in perl) | umen | Shell Programming and Scripting | 1 | 09-01-2006 01:02 PM |
| loop throw perl regexp selection | umen | Shell Programming and Scripting | 6 | 08-28-2006 11:35 AM |
| change function structure with perl (regExp) | umen | Shell Programming and Scripting | 1 | 08-19-2006 11:20 AM |
| Need Help with Perl REGEXP | mh53j_fe | Shell Programming and Scripting | 1 | 01-17-2006 09:49 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
perl regexp error , I cant understand what is wrong
perl regexp error , I cant understand what is wrong Hello all I have simple perl regexp that is searching for pattern in string and replace it with the same string + addition string here is what I have : Code:
my $rec = q| new Array("Attributes Management" ,"/ResourceManagement/Attribute/attributeFrameset.jsp","/Images/icons/attributes.gif",null,"AttributesManagement"),|;
Code:
rec =~ s/[^+\s*](\"\/.*?[jsp|gif|css|bmp|js]\")/handle_path($1,1)/gse; and the handle_path function lookes like this : Code:
sub handle_path {
my $s = $_[0];
my $type = $_[1];
if($type == 0){
return "Env.getPath()+".$s;
}elsif($type == 1){
my $tmpStr = "\<\%= Env.getPath() \%\>\+".$s;
return $tmpStr;
}
}
but the result im getting is almost fine .. there is missing comma in there , and i have no idea why the comma is missing after the switching . for example between the "Attributes Management" and <%= Env.getPath() %> Here is the result: new Array("Attributes Management" <%= Env.getPath() %>+"/ResourceManagement/Attribute/attributeFrameset.jsp"<%= Env.getPath() %>+"/Images/icons/attributes.gif",null,"AttributesManagement"), can someone please tell me what im doing wrong here? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|