No need for a variable, you can directly search/replace the clipboard
This should work:
Or, for the case that the first field (βWolverhamptonβ) might contain a space (βWolverhampton Southβ), this will be safer: (.+)\s+(\d+:\d+)\s
or (?m)^(.+)\s+(\d+:\d+)\s
The (.+) and (\d+:\d+) are captured matching groups. They will be remembered and reinserted into the result with $1 and $2 etc. Anything that is not captured (the two spaces here) will be replaced with the replacement string (commas here).
That's true for all of us, and it is hard to get started with RegEx. The syntax is unlike almost anything else I've ever seen. But it is so powerful . . .
Hi. I struggled through learning β well, getting off the ground, anyway β RegEx β¦ it pretty much exemplifies βarcaneβ. I found the following helpful:
Text Wrangler (recommended already in this thread; RegEx is called βGrepβ in TW; several helpful behaviors youβll probably notice when you start using it; free)
A slight problem with this site is that is doesnβt tell me which regex flavor is used. This can lead to some surprises when you paste your βtestedβ regex to your application or script.
As a user pointed out itβs probably the JavaScript regex. Other sites, like regex101 let you chose the flavor (PCRE, JS, Python).