| Dragon22 | stupid regex problem: I have "[a-z][A-Z][0-9].stuff I want" as a string how do I build a regex to do what I want I tried with sed, but sed -e 's/^[a-z][A-Z][0-9]*\.//' doesnt do it |
| nkts | Dragon22: what do you want from that string? |
| Dragon22 | everything after the . I'm trying to get the extension of a filename I /should/ be able to do this with sed if I can't, perl is good too. |
| nkts | Dragon22: print "stuff.ext" =~ /([^.]+)$/ |
| BinGOs | eval: my @m = "stuff.ext" =~ /([^.]+)$/; \@m |
| buubot | BinGOs: ['ext'] |
| fotoflo_ | arg im tired of gedit, i need a better texteditor |
| Dragon22 | roffle, it chokes sed |
| BinGOs | That's because it is perl regex. |
| Dragon22 | I know I tried just in case |
| BinGOs | GumbyBRAIN: Have you ever wondered how you get triangles from a cow ? |
| GumbyBRAIN | all i ever tell you how. |
| BinGOs | GumbyBRAIN: James Dean was just a careless driver. And Marilyn Monroe was just a slag. |
| GumbyBRAIN | And that just by the tty driver. |
| Dragon22 | oh you've got to be kidding me this should not work sed -e 's/[a-z]*[A-Z]*[0-9]*//' it chomps up to the first non alpha numeric character |
| BinGOs | Perhaps you want to start at the other end as it were. |
| Dragon22 | hmm I should convert this to a perl script |
| BinGOs | Dragon22: what do you want your sed substitution to do ? |
| Dragon22 | BinGOs: extension of a file name |
| BinGOs | remove the extension ? |
| Dragon22 | no, retrieve it ie, remove everything before the last dot |
| BinGOs | You are using a substitution |
| Dragon22 | yes, so? Im trying to nuke everything before the first dot |
| BinGOs | Yes, convert it to perl. Then we maybe able to help. |
| Dragon22 | <nkts> Dragon22: print "stuff.ext" =~ /([^.]+)$/ that does what I want in perl |
| f00li5h | yay stuff |
| BinGOs | Yay, f00li5h |