I need a regex to validate passwords with the following specs:
It must be between 6 and 20 characters with at least one upper case letter, one lower case letter and one digit
...
Not use any programming language. Only use regular expression. is it possible?
For example input>>
11
22
22 <-must remove
33
44
44 <-must remove
55
Output>>
11
22
33
44
55
...
For example:
$lang['Select Project'] = 'Select Project OK';
$lang['Project'] = 'Project';
I want to find only the instances of the word 'Project' not contained within the square brackets.
I'm using cold fusion studio's extended replace utility to do a global replace.
Any suggestions?
Code Sample Follows:
<?php
$lang['Project...
I have this HTML code (just an example):
Sem vestibulum blandit nostra, nullam imperdiet, pellentesque vel wisi sit fusce purus mi, porttitor lorem. Bibendum non phasellus ut ipsum massa sed, interdum per, facilisis facilis luctus fermentum et donec, tristique tristique non.</p>
<p align="justify"><a class="nemo" href="http://myserver.c...
I need to find all instances of strings within an xml node. To be more specific, I'd like to parse some XAML and place all strings within certain controls (label for one) and set them as attributes instead. So, instead of this
<Label>My string</Label>
I want this:
<Label Content="My string"></Label>
The regular expression I have ...
I need a simple regex to validate a phone number of the form x-y, where x and y can represent any number of digits and the dash is optional, but if it does show up it most be within the string (the dash must have digits at its left and right)
...
In my code, I use a regexp I googled somewhere, but I don't understand it. :)
preg_match("/^[\p{L} 0-9\-]{4,25}$/", $login))
What does that p{L} mean? I know what it does -- all characters with national letters included.
And my second question, I want to sanitize user input for ingame chat, so I'm starting with the regexp mentioned ...
Let's say I'm matching with a pattern that has subexpressions like this:
Regex myRegex = new Regex("(man|woman|couple) seeking (man|woman|couple|aardvark)");
string myStraightText = "Type is man seeking woman, age is 44";
MatchCollection myStraightMatches = myRegex.Matches(myStraightText);
string myGayText = "Type is man seeking man, ...
I'm trying to create a regex that will capture BB Codes, BB Codes with extra parameters ([url=http://]url[/url]) etc. and work properly with nested BB Codes.
I would then recursively parse the BB Codes starting with the inner most.
This is what I have so far, but it breaks when I try to match nested BB Code.
Pattern:
\[(.*)\b=?([^=]...
I'd like to replace all self-closed elements to the long syntax (because my web-browser is tripping on them).
Example
<iframe src="http://example.com/thing"/>
becomes
<iframe src="http://example.com/thing"></iframe>
I'm using python's flavor of regex.
...
i want to put rel=lightbox to some links that mediabox support using javascript.
i try this and wonder why it's not working?
test: http://jsbin.com/opica
please help edit this: http://jsbin.com/opica/edit
<script type="text/javascript">
var x=xmlDoc.getElementsByTagName("a");
var regexku=/^.+(((twit)|(tweet)|(com/video.+)|(flickr.c...
In Python. r^[\w*]$
whats that mean?
...
I understand that
* = "zero or more"
? = "zero or more" ...what's the difference?
Also, ?: << my book uses this, it says its a "subtlety" but I don't know what exactly these do!
...
How can I get only the first line of multiline text using regular expressions?
string test = @"just take this first line
even there is
some more
lines here";
Match m = Regex.Match(test, "^", RegexOptions.Multiline);
if (m.Success)
Console.Write(m.Groups[0].Value);
...
Hi
I'm a newbie
I am trying to create a regex in notepad ++ to replace all href="http://www.reactivemail.com/(any series of charcters)"
essentially all I want is to put a / on the end of all href's but only if it does not contain a dot e.g it is a path to a file like .html
so here is what i want to find
href="http://www.reactivemail.c...
I'm using this but it's replacing single occurances of a new line with <br/><br/>
function nl2br2($string){
$string = preg_replace('/(\r\n){2,}/', '<br/><br/>', $string);
//$string = preg_replace('/[\r\n]/', '<br/>', $string);
return $string;
}
It happens with the first pattern.
...
I need to parse some C++ files, and to make things easier for me, I thought about removing multiline comments. I tried the following regex : /(\/\*.*?\*\/)/, using the multiline modifier, and it seems to work. Do you think there will be any case where it will fail?
...
I use the following regular expression to validate a comma separated list of values.
^Dog|Cat|Bird|Mouse(, (Dog|Cat|Bird|Mouse))*$
The values are also listed in a drop down list in Excel cell validation, so the user can select a single value from the drop down list, or type in multiple values separated by commas.
The regular expressi...
Hi All
I would like to be able to remove content from a string of data.
This is an example string from google maps api.
Distance: 70.5 mi (about 1 hour 12 mins)<br/>Map data ©2009 Google
I would like everything in between the brackets (). So can I remove everything from either side with preg_split ?
Hope you can advise.
...
In particular: I want to replace all occurances of a full stop \. with a full stop plus white space \.\s if the full stop is immediately followed by an upper case character [A-Z].
Any suggestions? thanks
...