Skip to content

Tag: regex

Using symbols in an input to format text

I’m struggling to find a solution which allows a user to input in a input field, however they can style their text when it displays after the input for was submitted. For example, a user could enter **message** into the input field, JavaScript can detect that the ** on the start of the word/sentence and…

Javascript Regex multiple search in two words

I want to transfer the results between Regex and two words to an array, but unfortunately I couldn’t this. Can you help me? In this text I will search this content, Based on this I write a regex like this However, this way, it takes the whole, not piece by piece. Thank you in advance for your help. Answ…

Regex: remove everything except the letters and separator

I am currently using replace statements to replace certain parts of a string. I think my code is a bit over the top and could be simplified: In the end, I want to remove everything except for the locale from the string using regex and replace – with _. I would like the final string to look like this: An…

Javascript – How to extract text with regex

I am new to Regexes. Now I need to write one to suit my needs. I have this string: 1 [00:00:12.00 – 00:01:20.00] Hello there – I’ve come to help you. I would somehow need to bring it to this form: I have tried with this approach: But I am getting this error: Invalid regular expression: /$[^$…

Regex expression to match certain url behavior in my website

I have the following url I’ve trying to create a regEx so i can thrigger a script only when i’m in an article. i tried this among other tests but it didn’t work and i’m not really the best guy building RegExs. So in my understanding the first part of this regEx (/blogs/) is trying just…