0

I have been trying to form a regex for a pattern which will have a constant followed by 32 non white space characters followed by ^ and I want to retrieve the 32 characters.

So far I tried this:

(?<=joint=)(.*)(?=^)

eg: asap^joint=345342345678764gd45fd45dd3sff5g5^foodisready^feels=dsdsdsdsdsdsdsdsd45d3cdfsdsd3423^

I want 345342345678764gd45fd45dd3sff5g5 and I guess I am not escaping the special character at the end. Any pointers would be appreciated.

phantomsays
  • 187
  • 2
  • 11
  • 1
    check this out - https://regex101.com/r/llPSuB/1 – Rahul Desai Jun 14 '18 at 23:00
  • It is common knowledge `^` must be escaped to match a `^`. Else, it is a start of string anchor. `.*` must be made lazy with `?`, it is also a very common misunderstanding. And use a capturing group rather than lookarounds, it is more natural with JS since only Chrome and few ECMAScript 2018 compatible environments support lookbehinds. – Wiktor Stribiżew Jun 14 '18 at 23:01
  • https://regex101.com/ might help you start – Muhammad Omer Aslam Jun 14 '18 at 23:03

0 Answers0