Hello, I'm wondering if variable length lookbehind assertions are supported in JavaScript's RegExp engine?
For example, I'm trying to match the string "variable length" in the string "[a lot of whitespaces and/or tabs]variable length lookbehind", and I have something like this but it does not go well in various RegExp testers:
^(?<=[ ...
I've got addresses I need to clean up for matching purposes.
Part of the process is trimming unwanted suffices from housenumbers, e.g:
mainstreet 4a --> mainstreet 4.
However I don't want:
618 5th Ave SW --> 618 5 Ave SW
in other words there are some strings (for now: st, nd, rd, th) which I don't want to strip.
What would b...
I tried this but it doesn't work :
[^\s-]
Any Ideas?
...
I need a special regular expression and have no experience in them whatsoever, so I am turning to you guys on this one.
I need to validate a classifieds title field so it doesn't have any special characters in it, almost.
Only letters and numbers should be allowed, and also the three Swedish letters å, ä, ö (upper- or lowercase).
Besi...
I need to replace a substring from some string. I've already created corrected code for doing it. But I amn't sure is it best way. Please, see code below:
var str = 'test ruby,ruby on rails,ruby,'
var substr = 'ruby';
var reg = new RegExp(',' + substr + ',|^' + substr + ',', 'gi');
str.replace(reg, ','); //returns "test ruby,ruby on rai...
I am trying to set up an index page for the weekly magazine I work on. It is to show readers the names of
companies mentioned in that weeks' issue, plus the page numbers they are appear on.
I want to search all the PDF files for the week, where one PDF = one magazine page (originally made in
Adobe InDesign CS3 and Adobe InCopy CS3)....
I have a string like "{some|words|are|here}" or "{another|set|of|words}"
So in general the string consists of an opening curly bracket,words delimited by a pipe and a closing curly bracket.
What is the most efficient way to get the selected word of that string ?
I would like do something like this:
@my_string = "{this|is|a|test|case}...
I have an app that enables the user to input a regular expression, my question is how to check against any input of regular expressions and make sure they are valid ones because if they are not there will be preg_match errors.
I don't want to use the '@' before preg_match, so if there's a way to check the validity of the user input of r...
Hi.
I need reg exspression what make this "123.12312" -> "123.32", or "23.323" -> "23.32" in c#.
It must be only 2 digits after point
:)
...
Is there a difference between ^[a-zA-Z] and [^a-zA-Z]?
When I check in C#,
Regex.IsMatch("t", "^[a-zA-Z]") // Return true (I think it's correct)
Regex.IsMatch("t", "[^a-zA-Z]") // Return false
There are alot of web site using [^a-zA-Z] for alphabet. I'm not really sure which one is correct answer.
Could someone please shed the ...
I was using javascript to detect for specific key strokes and while writing the method I thought I'd try regular expressions and the test() method and came up with:
if (/8|9|37|38|46|47|48|49|50|51|52|53|54|55|56|57|96|97|98|99|100|101|102|103|104|105|110/.test(num)) {
// do something if there's a match
}
This doesn't seem to work...
solution:
this works:
String p="<pre>[\\\\w\\\\W]*</pre>";
I want to match and capture the enclosing content of the <pre></pre> tag
tried the following, not working, what's wrong?
String p="<pre>.*</pre>";
Matcher m=Pattern.compile(p,Pattern.MULTILINE|Pattern.CASE_INSENSITIVE).matcher(input);
if(m.find()){
...
Hello guys,
I was hoping to get a nice push in the right direction I would like to change the ending of my images sources string... i hope i worded that right.
Anyway my current src's are reading:
<img src="something/something/12345_m.jpg" />
I would like to change it to:
<img src="something/something/12345_t.jpg" />
Any idea guy...
I have the following expression:
^\w(\s(+|-|\/|*)\s\w)*$
This simply looks to match a mathematical expression, where a user is prompted for terms separated by basic operators (ex: price + tax)
The user may enter more than just 2 terms and one operator (ex: price + tax + moretax)
I tested this expression in Rubular http://rubular.com/...
Hello,
<u class="logout" href="/logout.php?h=970c9836674709e6dcdaadd094622fc5&t=1273295318" target="_top">Logout</u>
That above is what I want to search for.
I want to get h= and t= from that URL, or just get the entire url in href=""
How would I do this with regex?
...
I have a section of a book, complete with punctuation, line breaks etc. and I want to be able to extract the first n words from the text, and divide that into 5 parts. Regex mystifies me. This is what I am trying. I creates an array of index size 0, with all the input text:
public static String getNumberWords2(String s, int nWords){
...
@string = "Sometimes some stupid people say some stupid words"
@string.enclose_in_brackets("some") # => "Sometimes {some} stupid people say {some} stupid words"
How should the method enclose_in_brackets look ? Please keep in mind, I want only enclose whole words, (I don't want "{Some}times {some} stupid....", the "sometimes" word shou...
I have a need of checking whether there is the date in the string or not.
FUTIDX 26FEB2009 NIFTY 0 -- There is date in the string.
FUTIDX MINIFTY 30 Jul 2009 -- There is date in the string.
FUTSTK ONGC 27 Mar 2008 -- There is date in the string.
How can I do that ?
...
What should be the regex for matching date of any format like
26FEB2009
30 Jul 2009
27 Mar 2008
29/05/2008
27 Aug 2009
What should be the regular expression for that ?
I have regex that matches with 26-Feb-2009 and 26 FEB 2009 with but not with 26FEB2009. So if any one know then please update it.
(?:^|[^\d\w:])(?'day'\d{1,2}...
I have a PCRE regex that looks like this
s/(<input.+?)alt(=".+?".*?>)/$1title$2/
Can anybody help me with making that work on sed?
Eventually can anybody point me to some guide/blog post/whatever that explains differences between sed regex and PCRE?
...