Skip to content
Advertisement

Tag: regex

How to find a word that has surrounded with indicator? javascript

I have a string below which has some identifier to get an specific word on it. string example: “I will c#hec*k on it” the “#” indicates starting, and the “*” indicates for last. I want to get two strings. check – the whole word that has “#” and “*” on it. hec – string that was surrounded. I have started

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 make this text bold. Essentially

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. Answer In

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: Answer

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: /$[^$]++$/: Nothing to repeat

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 to match a fixed

Advertisement