All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
41 views

Zsh string pattern match to delete spaces

Trying to solve a code-golf problem using zsh, but my regex isn't working correctly. Requirement Given input string $1, delete all spaces immediately to the left of any ! character. Examples: ...
0
votes
0answers
23 views

grep -f not working with file

I have a file with having patterns separated by new line characters. which matches the patterns i want to find from a file. but when i run command grep -f patterns_file words_file It gives no ...
1
vote
1answer
40 views

Odd behavior (bug?) of sed when using $

I've got a problem and I am not sure whether this is a bug or if this is supposed to happen when using $ for addressing lines. Basically, I have the following command: sed -e '$s/test/tset/g' ...
0
votes
1answer
34 views

Extract pattern in perl

Is it possible to have just one regex which can extract the pattern "Mango-1.whatever.." in any of these 3 conditions (i.e. $dummy). I keep printing everything after this pattern. If I use comma in ...
2
votes
1answer
51 views

How do I avoid greping matching lines with -

I'm trying to grab only matching lines from a file using grep. The problem is that, when for example I use the following expression: grep -w AFFX-KIT-000088 textfile it will return: AFFX-KIT-000088-...
0
votes
2answers
61 views

AWK Split Variable

I have the following sequence in a file: AA MUi MUi-j MUi-N ABk ABk-l ABk-N MBk(i) MBk-l(i) MBk-l(i-j) MBk-l(i-N) MBk-N(i-j) MBk-N(i-N) I want to split it in small pieces: The first two chars will ...
0
votes
1answer
427 views

How to negate Bash's Regular Expression Matching Operator

Bash has the =~ regular expression matching operator. Here is an example of using it: #!/bin/bash input=$1 if [[ "$input" =~ "[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]" ]] # ^ ...