Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I tried this : [fl]ady?[ing] ?[rb]ug!?
I know [fl]ad[y]?(ing)? ?[br]ug!? is an answer
Can this be solved using character sets only? Must match both.
ladybug
fading rug!
I believe this should work for you
[fl]ad(y|ing)\s?[br]ug?
Check out http://www.regexpal.com/
Using character sets only? So, it doesn't matter what other letter combinations it matches as well? Mmm. Then
[fl]ad[giny]+[\sbrug!]+
would do. See: https://regex101.com/r/FJWJyM/1
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I want to write a regex for matching *#xxx[.]gr in js.
My regex so far :
/^(([^<>()\[\]\\.,;:\s#"]+(\.[^<>()\[\]\\.,;:\s#"]+)*)|(".+"))#((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
I want : *#xxx.gr
If I understand your specs correctly this should suit you:
/^[^<>()\[\]\\.,;:\s#"]+#[^<>()\[\]\\.,;:\s#"]{3}\[\.\][^<>()\[\]\\.,;:\s#"]{2}$/g
Demo: https://regex101.com/r/kfjAG9/2
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a sentence example: I am just one man I', trying to capture am just on with the following regex, but it also captures I which is not what I need.
(?=I).*(?= man)
The result is: I am just one
I don't want extra capturing groups, only the full match which should be am just one.
change the first positive lookahead to a negative (?!I). This won't capture I
(?!I).*(?= one)
By saying look and match anything except I
(?=[^I ]).*(?= man)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I need to check string if contains >< /!a-zA-Z or some of them (Also contains space). The only thing I know is a-zA-Z i need an example in C# or Javascript.
Use a "character class".
/[>< \/!a-zA-Z]/
Note that I've escaped the forward slash, since we're using forward slashes as delimiters.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to write regexp to find a string who start and ends with the same number like so :
2aldkc2 <----
4alou4 <----
edit , i forget to motion what i have tried so far :
^(\d).^([^h].*$)
but this doesn't work
Use capturing group.
^(\d).*\1$
The regex captures the first digit and match that particular line only if the last character is also the same as the one captured.
DEMO
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have this code:
$(this).text().replace(/write\s(\w+);/g, "$1");
and this text:
write testing code;
but show only "testing"!
How to take all words and show "testing code"?
thx
console.log($("#my_element").text().replace("write",""));
You don't need a regex if replacing the string "write" is all you want to do.
To change the element's inner html:
$("#my_element").html(($("#my_element").text().replace("write",""));
If I understand the question correctly you want to strip out the word write from the string and keeping the other words? If this is the case, you can do it like this:
$(this).text().replace(/(\s?)write(\s?)/g, '');