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.

i cant code
  • 305
  • 2
  • 7
  • 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]` – nathanvda Jan 23 '20 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. – i cant code Jan 23 '20 at 12:07

0 Answers0