Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I've made a regular expression for getting all background image patterns:
Pattern p = Pattern.compile("background(-image)?:[\\s]?url[\\s]*\([\\s]*(?<url>[^\)]*)[\\s]*\)[\\s]*");
But this will failed in this case, because of #66cc33:
background:#66CC33 url(images/bg-topbar.png)
Can anyone help me to modify my pattern?
You can use this regex, with basically doesn't care about anything but the url() content:
background(-image)?:.*?url\(\s*(?<url>.*?)\s*\)
This seems like a duplicate of this question https://stackoverflow.com/a/20857448/5856415, you should try the regex given in that answer to simply select text between the brackets.
/\((.*?)\)/)[1].replace(/('|")/g
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 days ago.
Improve this question
I used this lines of program for password validation, unfortunately other conditions are working but aside the special character.. what did I do wrong?
my JavaScript/jQuery code
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
This post was edited and submitted for review last year and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I'm a newbie in JS, and I don't know how to make pattern, that would replace ^ symbol. Much thanks in advance!
The regex pattern would be :
pattern=/\^/g
Then you can use
text.replace(pattern, 'replace with')
as simple as that.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have tried everything. My code doesn't render as HTML, instead it is just raw text.
This is my code:
$('#question').parseHTML(quiz[currentquestion]['question']);
How do I fix this?
Did you mean to use html() as output?
$('#question').html(quiz[currentquestion]['question']);
Or like this with $.parseHTML which is to parse a string into an array of DOM nodes.
var html = $.parseHTML(quiz[currentquestion]['question']);
$('#question').html(html);
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I do NOT have code here, as for it is going to take up too much space. It is an error in JavaScript as for it won't run anything in it, aswell as jQuery.
Click here if you wanna live...
Your problem is here I think:
.replace('function mName1()'),('?Method??-Custom?','function')
that comma needs to be a period and I'm guessing replace needs called.
.replace('function mName1()').replace('?Method??-Custom?','function')
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
i'm working on a form validation and i need a pattern for a paricular type of code.
it's like this:XXXX99999999.
this is the regex i made myself:[A-Za-z]{4}d{8}$
but it doesn't work
Try this:
[A-Z]{4}\d{8}
check it out here: http://regexr.com/3ao9d
var regex=/^[A-Za-z]{4}\d{8}$/
Test this in Developer console
var str="XXXX99999999";
str.match(regex)