regex - selecting all pairs of words in a string in bash -
How can you select all the pairs of later words in a text in the bash?
For example, for the string Should be changed in I have tried to use regular expressions, but it adds half the pairs only after the start of the maitter, where it is omitted, eg Please note: the original string is guaranteed to include only spaces and letters EDIT: I need a solution that I will later get pipeline in another program I can do You can use test test test
test tet test test tezt
echo "Test Test Test Tzat". Grep -Po '[a-zA-Z] + [a-zA-Z] +' does not produce only the first and third output, not the second.
awk :
s = 'test test test tezt' awk -v RS = '' 'NR & gt; 1 {Print P, $ 1} {p = $ 1} '& lt; & Lt; & Lt; "$ S" Exam Test Test Test Test
Comments
Post a Comment