Skip to content

Tag: regex

Removing “,” at the beginning of a line CSV

i want to convert a .csv file and write a new one. However I am not able to remove the first , i am kinda stuck here and it is driving me crazy. This is my code: That’s the output i am getting in the newly generated file Output extractedtasks: Output extractedtasksformated: Answer Because extractedtasks…

How to match two or more words name in javascript regex?

I’m trying to verify that there are at least two words name, where a word is only alphabet for example: This is the regex I’m currently using just to verify letters and spaces I have searched and tried one of them on this link but it didn’t work link Can anyone help me to verify name more th…

the right regex for catching a part of url

There are some cases of URLs like below. I need the right regex for catching the “55” or “5” part of those URLs. What I tried was /(?:/category/w+)(/category/)|(d+[^/])/g However, this regex also catches the “3031” in case (3), “30” in case (4). And it cannot ca…

regex works in js but fails in html

I got a regex for matching URIs of YouTube it works well in js but why it fails in html input[pattern] ? Please match the requested format Answer HTML input patterns have an implicit $ at the end, meaning that it expects to match the entire input. You’re not accounting for the &list=RDT4X7Ev7RIZA&am…

combine regex to match subgroups in different order

I have a string with may have one of the 2 below structure some examples would be The goal is to match as below I can manage to get the result with 3 regex, but not with 1 How can I get the expected result with a single regex ? Answer Maybe use | to separate possible matches: Also note