wtfacoconut
March 5th, 2011, 02:02 AM
Hey there. Here's my issue.
I need to use either awk, grep, sed, or what ever it is so that I can use a regular expression to extract the information that I want from a block of text and append it a variable.
Example text block:
asdfjkhawelkj Rev.0.1 034987ryhiduf0 Rev. 0.1
Rev.0.1 lkjoijndfpowieofenapowe4o Rev 0.1 84puio 498r4n9pf8
Example regular expression:
/Revs[0-9]\.[0-9]/
Example 0utput:
Rev 0.1
Please, the answer must use regular expressions inorder to search through a block with no consistent formatting in order to get the desired output.
I've looked at a $|-|1t ton of regular expression and AWK tutorials and looked at enough threads without getting much luck. So if there is already a tutorial out there, my bad, I'm not a lazy mofo, I just honestly couldn't find it.
Thanks to everyone in advance!
I need to use either awk, grep, sed, or what ever it is so that I can use a regular expression to extract the information that I want from a block of text and append it a variable.
Example text block:
asdfjkhawelkj Rev.0.1 034987ryhiduf0 Rev. 0.1
Rev.0.1 lkjoijndfpowieofenapowe4o Rev 0.1 84puio 498r4n9pf8
Example regular expression:
/Revs[0-9]\.[0-9]/
Example 0utput:
Rev 0.1
Please, the answer must use regular expressions inorder to search through a block with no consistent formatting in order to get the desired output.
I've looked at a $|-|1t ton of regular expression and AWK tutorials and looked at enough threads without getting much luck. So if there is already a tutorial out there, my bad, I'm not a lazy mofo, I just honestly couldn't find it.
Thanks to everyone in advance!