Visual Studio Code – Make multi line regex non greedy (=lazy)
I have a snippet of code like this: { a: { b: 1, c: 2, }, d: { e: 4, f: 5, }, } I need a regex which matches the two objects a and d seperately. First match: a:…
I have a snippet of code like this: { a: { b: 1, c: 2, }, d: { e: 4, f: 5, }, } I need a regex which matches the two objects a and d seperately. First match: a:…
I have a file with lines of text that looks like this: category1.name1 name2 I want the output to look like this: category1 name1 name2 I'm editing this file in VS Code on a Mac. I'm happy to use regex…
I've found this regex that seems to work for Java but not python. found it here: Regex: Remove Commas within quotes r"""(G(?!^)|"body"s*:s*")([^",]*),""" I am very inexperienced with building my own regexes and need help translating it to python acceptable format.…
I have this string: 'Slope fields are constructed by plotting tiny line segments at various points in the $xy$-plane. The slope of each line segment is given by the value of $f(x, y)$ at that corresponding point. These line segments…
I need to check that a string input contains exactly 2 special characters and 1 number. is this the correct regex for this job? (?=(.*[`!@#$%^&*-_=+'/.,]){2}) this is only checking special characters and not numbers. I tried the regex above and…
Since i try to used this regular expression /names+([A-Za-z0-9]+(?:-[A-Za-z0-9]+)*[A-Za-z0-9])(?!S)/g; my input that i want is for example: name test name test-name name test-name-2 but when i try to check this input it's also allowed name test-name anytext what i want…
So I have this text that I extracted out of a <script> tag. function fbq_w123456as() { fbq('track', 'AddToCart', { contents: [ { 'id': '123456', 'quantity': '', 'item_price':69.99 } ], content_name: 'Stackoverflow', content_category: '', content_ids: ['w123456as'], content_type: 'product', value: 420.69, currency:…
I have a code that creates a CSS selector by traversing through the dom to that particular element, but here lies the case I use tailwind, and sometimes the tailwind classes are causing a problem for me so I don't…
I want to forbiden to write more that one dot, as well i want to forbiden to write more that one comma if there is already an dot (.) should not allow to write other dot(.) or comma (,) and…
The string is not valid json so i don't think there's a simple solution that would allow me to use JSON.parse. Although i may be wrong. Problem I have a string of key value pairs and would like extract them…