0

I'm trying to isolate the second field, comma-separated, in an already matched substring. My source string is something like this:

Info: 10.10.10.10 "TryingToIsolate" - [14/Mar/2016:15:44:00 +0100] "GET http://www.google.com" 200 12 £GG_sear,**44**,3,"-",-,-,-,1,"-",-,-,-,"-",1,-,"-","-",-,-,GG_sear,-,"-","-","Unknown","Unknown","-","-",234,0,-,"-","-",-,"-",-,-,"-","-"£ - "None-Default-None-Default-None"

I would like to get the value 44 within the £ symbols. I can get easily whatever is within the "££" by using \£(.*)\£, but whatever I try for taking out the second field it doesn't work properly.

2
  • what is your input string from which you are trying to extract ? also I cannot see <> in your example Commented Mar 14, 2016 at 17:15
  • Apologies, I meant: "...and I would like to get the vaule 44 between the "£" characters. I can get easily whatever is within the "££" by using: \£(.*)\£ but whatever I try for taking out the second field it doesn't work properly. I apprecciate any help..." Commented Mar 14, 2016 at 19:13

1 Answer 1

0

If you are sure it is going to be numeric only, then you can catch it with the regex

£\w+,(\d+),.*£

Here's a demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.