1

Take the following sample 2 data string and pattern.

value: webiste_landing_page_string?prs=kdfjg_sdfkrgfdkj=klfdjgldf;£lkjfsd£
value: webiste_landing_page_string?prs=klfdjgldf;£lkjfsd_io43"fdlkj;dfgfgg

pattern: prs=16

I need to return x chars after 'prs=' from the value strings, I will also be giving a pattern like 'prs=16' which tells me to return 16 chars after 'prs=' from the string.

Any help greatly appreciated.

2
  • What is the context? Are you having to parse a list of strings? Is this inside a controller and is this the visited url? E.g. can you access params[:prs] Commented Jan 23, 2020 at 11:33
  • it's actually a column in a csv and i need to extract the string based on the pattern. The csv i have parsed into a string. Commented Jan 23, 2020 at 12:07

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.