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
Tag: 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
Extract URLs from paragraph or block of text using a regular expression
I have a text and a script The expected outcome must be but the below getMatch is giving me incorrectly (skipping &x=y1) How do I modify the function to return a complete URL NOTE: This happens only when the email arguments are passed after it finds @ character, the function behaves weird. Answer Why not simplify:
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
JavaScript replace special HTML (&character; format) character in a String
I’m trying to replace the square root symbol which is written in html as “√” (√). I used the following line to replace it with a space but it does not change the String at all. What am I doing wrong here? Answer This answer is valid if you are accessing the innerText or innerHTML atribute of an Element. As
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
JavaScript – Remove strange characters from string
How do I remove these strange characters from a string? I have been trying with regex, but with no success. Before Remove: RegExr was created by gskinner.com, and is proudly hosted by Media Temple. *…