Skip to content
Advertisement

Tag: regex

Regex pattern for extraction of double-quoted and non-quoted strings Javascript

im desperately trying to extract double quoted and non-quoted words from following string (Please note the single quotes around): Desired groups are: “Cloud Technology” Foundation “Board” I came up with this pattern (?:”(.*?)”)|(?:s(S*?)s) have a look in regex101.com But the pattern doesnt works if the string would be for example ‘”Cloud Technology” Foundation’ Answer You can use See the regex

Regex match any characters in string, up until next match

I have this string: title: one description: two and want to split it into groups like [title: one, description: two] this was my attempt, but it only captures up to the : and 1 space after, it does not include the text after it, which I want to include all of, up until the second match. Answer Split on a

Highcharts X axis date bold

I am trying to make the date bold and red color in my highcharts x axis where time is also present in 12 hour format. I have done the following code but it is making all of the elements in x axis as bold as my time is in 12 hour format. How do I achieve this ? Answer Try

How to replace Unicode characters in the following scenario using javascript?

How to replace Unicode characters in the following scenario using javascript? Using javascript I want to replace Unicode characters with a wrapper according to their style. If possible include a range of Unicode characters([a-z]) in regex for styles other than regular. input = abc𝑢𝑣𝑤𝑥𝐚𝐛𝐜𝐝𝒇𝒈𝒉𝒊 expected ouput = <span class=”regular>abc</span><i> 𝑢𝑣𝑤𝑥</i><b>𝐚𝐛𝐜𝐝</b><b><i>𝒇𝒈𝒉𝒊</i></b> Answer I think it’s just a matter of finding the

Regex for numbers with spaces and + sign in front

If i want to accept only numbers then i will use this regex but the problem here is that the numbers like +1 00 are not catched and my regex will show that it is invalid The user needs to type only numbers but only one space in between is allowed and + sign at the beggining should be optional.

Regular expression to convert html class to attribute

Is there any way to use regular expression alone or with help of javascript to do the following from to Answer This regular expression will match what you describe, regardless of the position of “type-xxx” in class attribute Combining with a string replace this will yield the result

Regex: To allow commas in excel file name

I have JavaScript code that reads the content of an excel file. The first step is to assign a regex to a variable of the name regex Then some programming occurs like: At times users submit excel files that in their names, they put commas, and that breaks the regex. I would like to ask for help so that I

Advertisement