Grep Command Experssion
:: Get host
grep -Eao 'rtmp.{40}' plugin-container.dmp | sort -u What is the . for? Also, what do you think the {40} accomplishes? I don't need help with the | sort -u part. I know what it is for. |
You may be missing a coma(,) between 4 and 0.
If coma is there it will grep rtmp.4, rtmp.0 from plugin-container.dmp |
Not missing comma
I've seen the same code line in different places around the web and the line is the same - no comma.
Here's where I got this line of code from: http://svnpenn.blogspot.com/2011/07/...osts-file.html Anybody else know what the rtmp.{40} bit does? |
. - any character
{40} - 40 of the previous character |
40 periods
That would mean that the server name path would contain 40 periods. This doesn't make any sense...
Do we have anymore experienced people? |
Quote:
You are using grep -E, which means that the regex is using the "extended" syntax. In that syntax, "{x}" means "x occurences of the previous regex". "." means "any character". SO....."rtmp.{40}" means "rtmp, followed by any 40 characters (including spaces)" Who said it meant 40 periods? |
Quote:
|
wild characters
For some reason I overlooked that the other poster said that "." means any character. I'm used to using * or ? as the only wild characters. This is the first time I see a period used as a wild character. I guess I'm a bit rusty...
So now I see that what he wants is "rtmp" plus "://" and then the rest of the host address. |
The difference is that wildcards used the way you mentioned are for globbing in the shell (on the command line), however the example you are using here is a regular expression and hence
quite a different beast. If you search for regular expression or regex you will find a slew of information. |
All times are GMT -5. The time now is 10:47 PM. |