Skip to content

Tag: regex

Regex, match values inside of curly brackets

Having the next string { Hello, testing, hi stack overflow, how is it going } Match every word inside of curly brackets without the comma. I tried this: {(.*)} which take all, commas and brackets included. {w+} I thought this will work for words but it wont, why? Updated Tried this but I got null, why? Answer…

Strip everything after the last sentence [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I have this string: Using javascript regex, how can I strip everything tha…

Regex – split string with delimiters into groups

It’s needed to parse strings like: object/custom/name1/name2 object/custom/name1/name2/typea object/custom/name1/name2/typea/item The result I’m expected to get is: group1: name1/name2 group2: typea group3: item Only group1 (the group with name) is required. Other groups (2,3) are optional. It dep…

Cut and paste part of the string

I am using my own tags. They start with [ and end with ]. I would like to sort the tags. So instead of it should be This is what I have tried so far: So the tag [DYNAMIC] has been removed, which is good but it should be also placed at the beginning of the string. How can I