0
votes
3answers
60 views

Bash Combine Replacement and Sub String Extraction in One Step

For a string in this format: ./my-site.sub.domain.com I would like to remove the .,-, and /, and trim the remainder to 16 characters: mysitesubdomainc I've done this ...
2
votes
1answer
246 views

How to print strings matching a pattern with grep?

I want to get a list of strings matching the following pattern: CLASS_NAME:"*" where * represents any number of characters. I tried: grep -o CLASS_NAME:\".*\" script.js and grep -o ...
1
vote
3answers
93 views

a string representation using regex (modified)

I would like to use regular expression to represent a pattern with the following type of characteristics 1) It includes a continuous sequence of digit values. The length of this sequence it at least ...
1
vote
2answers
2k views

Pattern matching from the input arguments

we're trying to enhance the scripts. Users will pass some arguments and part of the arguments will have 5.0.3 For an example the input argument would be like Jboss5.0.3GA. Since it ( Jboss5.0.3GA ) ...
2
votes
3answers
593 views

How to reverse-match a string in the Vim programming language?

I want to find the last index of any character in the [abc] set in the abcabc string but the search should start from the end of the string: " Returns the 0th index but I want the 5th. let ...
2
votes
3answers
588 views

Find word in sentence with Bourne Shell (sh)

I'm trying to determine if a particular word appears in a sentence using Bourne Shell (sh). For example: #!/bin/bash INPUT='Lorem ipsum dolor sit amet.' if [[ "$INPUT" == *dolor* ]] then echo ...
0
votes
1answer
147 views

awk extended pattern matching (embedding pattern matching in actions for already matched strings) [closed]

I want handle strings of the form: PREFIX_TYPE_N,DATA So, does the *awk (gawk, mawk, nawk) support including pattern matching in the action for already matched string? Something like this (of ...
2
votes
4answers
601 views

Stripping all vowels but the first from a set of strings

I have a string comprised of multiple substrings, separated by underscores. For example: AbcdAEfd_hEgdgE_AbAAAAA. I need to remove all vowels except the first from each substring. So: AbcdAEfd -> ...
3
votes
3answers
991 views

Extracting text from a text file in bash

I have a large text file that is all one line. In the text are several sections that looks like foo=12345 and I need to extract them all as separate lines, ignoring the rest of the file. For ...
2
votes
3answers
148 views

expr help - managing strings

I need to take text like this: A234321=http://www.google..... a normal URL And pull out only the URL, getting rid of the first part. I think I can use expr to do it, but I can't figure out the ...