Skip to main content
6 events
when toggle format what by license comment
Feb 21, 2019 at 20:06 comment added Tryna Learn Somethin @jogle900 $ curl https://example.com | grep -Po '(Welcome to websrvapp01\d+)|(webapp\s\d+)' will match "Welcome to websrvapp01" aswell as "webapp 1" and also "webapp 02"
Feb 21, 2019 at 19:10 comment added jogle900 Matej - Your example worked great as well and it simpler for this specific task. I did UPvote as well. Thank you,
Feb 21, 2019 at 19:10 comment added jogle900 Tryna - The second example didn't work for me. I got the following error: -bash: syntax error near unexpected token `(' These examples are still very useful and appreciated.
Feb 21, 2019 at 18:57 comment added jogle900 Tryna - This is good. I am indeed trying to catch the following two letters/digits after the host name (webappsrv01/02) etc. I made a mistake though. Some of the older servers in our lab have text like this: "webapp 1" or "webapp 2". IS it possible to skip a space and the grab then grab the number? Can you show me that please? I did Upvote but I don't have enough reptuation credits for it show up.
Feb 21, 2019 at 18:33 history edited Tryna Learn Somethin CC BY-SA 4.0
added 150 characters in body; added 4 characters in body
Feb 21, 2019 at 18:27 history answered Tryna Learn Somethin CC BY-SA 4.0