0

Can anyone solve this regex?

  • Find all character strings that starts with a (,PE) and ends with a (,)
  • How to replace the BEGIN (,'PE) and END (',), and keep the MIDDLE (* unknown words here *)?
  • So the example above would have started ,PE unknown words here, and ended ,'PE unknown words here',

Does anyone know of a learning resource for regex so I can solve problems like this on my own?

REGEX PUZZLE

HAVE...

,(96, 4, 7517, 'NEELAM FOODS INC', '001', PE NEELAM 10885 BEALETON, 100, 'GI FOODS, LLC', 1492985, 933308, '12-APR-19', '15-APR-19', 639.68, '07', 639.68, 60)
,(97, 5, 7517, 'NEELAM FOODS INC', '001', PE NEELAM 10885 BEALETON, 100, 'GI FOODS, LLC', 1493358, 934184, '16-APR-19', '17-APR-19', 475.38, '07', 475.38, 58)
,(115, 1, 7692, 'INDUS FOODS INC', '001', PE INDUS FOODS 11070, 100, 'GI FOODS, LLC', 1492297, 932026, '09-APR-19', '09-APR-19', 804.18, '07', 804.18, 66)
,(116, 2, 7692, 'INDUS FOODS INC', '001', PE INDUS FOODS 11070, 100, 'GI FOODS, LLC', 1492513, 932656, '10-APR-19', '11-APR-19', 724.22, '07', 724.22, 65)
,(117, 3, 7692, 'INDUS FOODS INC', '001', PE INDUS FOODS 11070, 100, 'GI FOODS, LLC', 1492871, 933265, '12-APR-19', '13-APR-19', 1115.06, '07', 1115.06, 63)
,(118, 4, 7692, 'INDUS FOODS INC', '001', PE INDUS FOODS 11070, 100, 'GI FOODS, LLC', 1493162, 933660, '15-APR-19', '16-APR-19', 843.08, '07', 843.08, 60)
,(120, 1, 7820, 'CHICKEN-R-US INC', '001', PE CHICKEN-R-US 11191, 200, 'DUMMY CO *fake*, LLC', 1492183, 932077, '08-APR-19', '09-APR-19', 599.7, '07', 599.7, 67)
,(121, 2, 7820, 'CHICKEN-R-US INC', '001', PE CHICKEN-R-US 11191, 200, 'DUMMY CO *fake*, LLC', 1492932, 933330, '12-APR-19', '13-APR-19', 1174.46, '07', 1174.46, 63)
,(122, 3, 7820, 'CHICKEN-R-US INC', '001', PE CHICKEN-R-US 11191, 200, 'DUMMY CO *fake*, LLC', 1493196, 933702, '15-APR-19', '16-APR-19', 719.64, '07', 719.64, 60)
,(123, 1, 7835, 'KASHMIRWALA ENTERPRISES INC', '001', PE KASHMIRWALA 11222, 100, 'GI FOODS, LLC', 1492298, 932028, '09-APR-19', '09-APR-19', 1048.64, '07', 1048.64, 66)

WANT (with regex find/replace)...

,(96, 4, 7517, 'NEELAM FOODS INC', '001', 'PE NEELAM 10885 BEALETON', 100, 'GEORGES FOODS, LLC', 1492985, 933308, '12-APR-19', '15-APR-19', 639.68, '07', 639.68, 60)
,(97, 5, 7517, 'NEELAM FOODS INC', '001', 'PE NEELAM 10885 BEALETON', 100, 'GEORGES FOODS, LLC', 1493358, 934184, '16-APR-19', '17-APR-19', 475.38, '07', 475.38, 58)
,(115, 1, 7692, 'INDUS FOODS INC', '001', 'PE INDUS FOODS 11070', 100, 'GEORGES FOODS, LLC', 1492297, 932026, '09-APR-19', '09-APR-19', 804.18, '07', 804.18, 66)
,(116, 2, 7692, 'INDUS FOODS INC', '001', 'PE INDUS FOODS 11070', 100, 'GEORGES FOODS, LLC', 1492513, 932656, '10-APR-19', '11-APR-19', 724.22, '07', 724.22, 65)
,(117, 3, 7692, 'INDUS FOODS INC', '001', 'PE INDUS FOODS 11070', 100, 'GEORGES FOODS, LLC', 1492871, 933265, '12-APR-19', '13-APR-19', 1115.06, '07', 1115.06, 63)
,(118, 4, 7692, 'INDUS FOODS INC', '001', 'PE INDUS FOODS 11070', 100, 'GEORGES FOODS, LLC', 1493162, 933660, '15-APR-19', '16-APR-19', 843.08, '07', 843.08, 60)
,(120, 1, 7820, 'CHICKEN-R-US INC', '001', 'PE CHICKEN-R-US 11191', 200, 'DUMMY CO *fake*, LLC', 1492183, 932077, '08-APR-19', '09-APR-19', 599.7, '07', 599.7, 67)
,(121, 2, 7820, 'CHICKEN-R-US INC', '001', 'PE CHICKEN-R-US 11191', 200, 'DUMMY CO *fake*, LLC', 1492932, 933330, '12-APR-19', '13-APR-19', 1174.46, '07', 1174.46, 63)
,(122, 3, 7820, 'CHICKEN-R-US INC', '001', 'PE CHICKEN-R-US 11191', 200, 'DUMMY CO *fake*, LLC', 1493196, 933702, '15-APR-19', '16-APR-19', 719.64, '07', 719.64, 60)
,(123, 1, 7835, 'KASHMIRWALA ENTERPRISES INC', '001', 'PE KASHMIRWALA 11222', 100, 'GEORGES FOODS, LLC', 1492298, 932028, '09-APR-19', '09-APR-19', 1048.64, '07', 1048.64, 66)
SherlockSpreadsheets
  • 2,062
  • 3
  • 27
  • 47
  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Jun 18 '19 at 12:49
  • @WiktorStribiżew - Thanks for sharing the regex tutorial article. – SherlockSpreadsheets Jun 18 '19 at 13:02

0 Answers0