How would I write a regular expression (C#) which will check a given string to see if any of its characters are characters OTHER than the following:
a-z
A-Z
Æ æ Å å Ø ø - '
Thanks!
Hi,
i need to check a string that should contain only ABCDEFG characters, in any sequence and with only 7 characters. Please let me know the correct way of using regular expression.
as corrently i am using
String abs = "ABPID";
if(!Pattern.matches("[[ABCDEFG]", abs))
System.out.println("Error");
i am using the following code which works when i use the String abcdefg but for other cases it fails. please help me out.
Hi ,
I am finding Email ids in mu project, where I am preprocessing the input using some Regular Expression.
RegExpPhone6.RegComp("[\[\{\(][ -]?[s][h][i][f][t][ -]?[+-][2][ -]?[\]\}\)]");
Here while I am compiling i am getting a warning msg like
Warning 39 warning C4129: ')' : unrecognized character escape sequence
How can i resolve this ?
Why this is occuring and Where will it affect?
Kindly help me...
Hi,
I have a div tag, nested with many span and div tags inside it.
now i want a regular expression in javascript which will strip the div and the content inside it.
thanks in advance..
Which regular expression can I use to match (allow) any kind of letter from any language
I need to match any letter including any diacritics (e.g. á, ü, ñ, etc.)
and exlude any kind of symbol (math symbols, currency signs, dingbats, box-drawing characters, etc.) and punctuation characters.
I've tried using
\p{L}\p{M}*
but it doesn't work.
I'm writing an application that displays data using Google Earth.
In certain situations, it would be more convenient if, rather than displaying satellite images, the surface of the earth would look more like the 'regular map' on Google Maps.
Is this possible?
Hello I need help with Regular Expression,
I want to match each section (number and it's text - 2 groups), the text can be multi line, each section ends when another section starts (another number) or when .END is reached or EOF.
Demo
Expression:
\(\d{1,3}\) ([\s\S]*?)(\.END|\(\d{1,3}\))
Input text:
(1) some text some text
some text some text
some text some text
(2) some text some textsome text
(3) some textsome text
some textsome textsome text
(4) some text
.END
first group should match number (with brackets) and second group should match corresponded text.
I have this situation(Java code):
1) a string such as : "A wild adventure" should match.
2) a string with adjacent repeated words: "A wild wild adventure" shouldn't match.
With this regular expression: .* \b(\w+)\b\s*\1\b.* i can match strings containing adjacent repeated words.
How to reverse the situation i.e how to match strings which do not contain adjacent repeat words
I have a string of names like this "J. Smith; B. Jones; O. Henry"
I can match all but the last name with
\w+.*?;
Is there a regular expression that will match all the names, including the last one?
I want regular expression that checks
that the string doesnt start with an
empty space.
Some what like this i want to do :
Is the below ValidationExpression right for it :
string ValidationExpression = @"/^[^ ]/";
if (!String.IsNullOrEmpty(GroupName) && !Regex.IsMatch(GroupName, ValidationExpression))
{
}
I am trying to write a regular expression for somethin like
s1 = I am at Boston at Dowtown
s2 = I am at Miami
I am interested in the words after at eg: Boston, Downtown, Miami
I have not been successful in creating a regex for that. Somethin like
> .*? (at \w+)+.*
gives just Boston in s1 (Downtown is missed). it just matches the first "at" Any suggestions
I have a string something like this:
"2014-01-23 09:13:45|\"10002112|TR0859657|25-DEC-2013>0000000000000001\"|10002112"
I would like to split by pipe apart from anything wrapped in double quotes so I have something like (similar to how csv is done):
[0] => 2014-01-23 09:13:45
[1] => 10002112|TR0859657|25-DEC-2013>0000000000000001
[2] => 10002112
I would like to know if there is a regular expression that can do this?
I know you can generate all permutations from a list, using glob or Algorithm::Permute for example - but how do you generate all possible permutations from a regular expression?
i want to do like:
@perms = permute( "/\s[A-Z][0-9][0-9]/" );
sub permute( $regex ) {
# code - put all permutations of above regex in a list
return @list;
}
I have a regular expression, links = re.compile('<a(.+?)href=(?:"|\')?((?:https?://|/)[^\'"]+)(?:"|\')?(.*?)>(.+?)</a>',re.I).findall(data)
to find links in some html, it is taking a long time on certain html, any optimization advice?
One that it chokes on is http://freeyourmindonline.net/Blog/
Hi
Please help me with a regular expression to validate the following format
dd/mm
This is for validating a Birthday field and the year is not required.
Thanks
I need regular expression to match braces correct e.g for every open one close one
abc{abc{bc}xyz} I need it get all it from {abc{bc}xyz} not get {abc{bc} I tried this
({.*?})
I need a regular in expression in PHP that I can plug into preg_match_all and find if an @ sign and any character number or letter follows right after that. So if I put "@patrick hello there" it will come up true, if I put in "I saw her @ the mall" it will be false.
Thank you :)
I have this piece of code:
function func1(text) {
var pattern = /([\s\S]*?)(\<\?(?:attrib |if |else-if |else|end-if|search |for |end-for)[\s\S]*?\?\>)/g;
var result;
while (result = pattern.exec(text)) {
if (some condition) {
throw new Error('failed');
}
...
}
}
This works, unless the throw statement is executed. In that case, the next time I call the function, the exec() call starts where it left off, even though I am supplying it with a new value of 'text'.
I can fix it by writing
var pattern = new RegExp('.....');
instead, but I don't understand why the first version is failing. How is the regular expression persisting between function calls? (This is happening in the latest versions of Firefox and Chrome.)
Edit Complete test case:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Test Page</title>
<style type='text/css'>
body {
font-family: sans-serif;
}
#log p {
margin: 0;
padding: 0;
}
</style>
<script type='text/javascript'>
function func1(text, count) {
var pattern = /(one|two|three|four|five|six|seven|eight)/g;
log("func1");
var result;
while (result = pattern.exec(text)) {
log("result[0] = " + result[0] + ", pattern.index = " + pattern.index);
if (--count <= 0) {
throw "Error";
}
}
}
function go() {
try { func1("one two three four five six seven eight", 3); } catch (e) { }
try { func1("one two three four five six seven eight", 2); } catch (e) { }
try { func1("one two three four five six seven eight", 99); } catch (e) { }
try { func1("one two three four five six seven eight", 2); } catch (e) { }
}
function log(msg) {
var log = document.getElementById('log');
var p = document.createElement('p');
p.innerHTML = msg;
log.appendChild(p);
}
</script>
</head>
<body><div>
<input type='button' id='btnGo' value='Go' onclick='go();'>
<hr>
<div id='log'></div>
</div></body>
</html>
The regular expression continues with 'four' as of the second call on FF and Chrome, not on IE7 or Opera.
What will be the regular expression in javascript to match a name field,
which allows only letters, apostrophes and hyphons?
so that jhon's avat-ar or Josh is valid?
Thanks
What will be proper regular expression for git repositories?
example link:
[email protected]:someone/someproject.git
so it will be like
server can be url or ip
Project can contain some other characters than alphanumeric like '-'
I'm not sure what is the role of '/'
any suggestions?
I need help on regular expression on the condition (4) below:
Begin with a-z
End with a-z0-9
allow 3 special characters like ._-
The characters in (3) must be followed by alphanumeric characters, and it cannot be followed by any characters in (3) themselves.
Not sure how to do this. Any help is appreciated, with the sample and some explanations.
I know this may be the simplest question ever asked on Stack Overflow, but what is the regular expression for a decimal with a precision of 2?
Valid examples:
123.12
2
56754
92929292929292.12
0.21
3.1
Invalid examples:
12.1232
2.23332
e666.76
Sorry for the lame question, but for the life of me I haven't been able to find anyone that can help!
The decimal place may be option, and that integers may also be included.
I need to change some characters that are not ASCII to '_'.
For example,
Tannh‰user - Tann_huser
If I use regular expression with Python, how can I do this?
Is there better way to do this not using RE?
I am an amateur in JavaScript. I saw this other question, and it made me wonder.
Can you tell me what does the below regular expression exactly mean?
split(/\|(?=\w=>)/)
Does it split the string with "|"?
Hi
what will be the regular expression to extract challenge var value
i am interested in this vlaue
03AHJ_Vut9LJLOJuCsjF9PbSSMncTyUe7Y4dHX11eRLae3LGfDZ0hSfDR7jZq2ZrKJxyC-LRSSppv72oHKaQMsd-EnoVNL6p7liTh7siN26zzTA_E2rcC_JQ15613Azz4qm8HjPtAyksUdc7QZydszwolk92hBPrAAig
this value changes every time we refresh it so the expression has to be generic enough to pick up what ever is the value
var RecaptchaState = {
site : '6LeKCL8SAAAAADV5Dr-lfY2eOEV8rubeN25BAKp2',
challenge : '03AHJ_Vut9LJLOJuCsjF9PbSSMncTyUe7Y4dHX11eRLae3LGfDZ0hSfDR7jZq2ZrKJxyC-LRSSppv72oHKaQMsd-EnoVNL6p7liTh7siN26zzTA_E2rcC_JQ15613Azz4qm8HjPtAyksUdc7QZydszwolk92hBPrAAig',
is_incorrect : false,
programming_error : '',
error_message : '',
server : 'http://www.google.com/recaptcha/api/',
timeout : 18000};
any help will be appreciated, or any method to extract this value in any server side lang