In IE, "x".split(/(x)/).length returns 0
In Firefox, Chrome, Safari, and Opera, it returns 3.
Does anybody know the reason why? If possible, a reference link will be greatly appreciated.
I believe that it is a IE regex implementation issue, but I can't find any document about that.
...
How to match the following sequence:
You wound DUMMY TARGET for 100 points of damage
but not:
You wound DUMMY TARGET with SKILL for 100 points of damage
with the regular expression:
^You wound ([\\w\\s]+)(?!with) for (\\d+) points of damage
The regular expression above is matching both strings while i expect to match only the fi...
Hi,
is it possible to include a large block of a regex (like this one: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html) without escaping all colliding characters first?
i think of something like
\begin{following_section_will_not_be_parsed_by_latex}
(a+?b)
\end{...}
thank you!
Andrew
...
Hi,
I'm trying to parse a Powershell script for its functions and parameters. I am almost there, byt I am having troubles with newlines. The expression parses test2 to test6 fine but with test1 I cannot get it to work.
I could of course specify my clients do not use the first syntax, but there must be a way. Can someone point me in the...
I want to remove all occurrences of URL [full path, query string] from the text in Python. Any suggestions on how to do this? I am new to regex!
http://example.com/url/?x=data
This whole URL should be removed!
Thanks
...
I'm trying to remove LEFT-TO-RIGHT-MARK (\u200e) and RIGHT-TO-LEFT-MARK (\u200f) from a string before encoding it as JSON. Neither of the following seems to work:
$s = mb_ereg_replace("\u200e", '', $s);
$s = preg_replace("#\u200e#u", '', $s);
$s = preg_replace("#\u200e#", '', $s);
Any help is appreciated!
...
This is a great regular expression for dates... However it hangs indefinitely on this one page I tried... I wanted to try this page ( http://pleac.sourceforge.net/pleac%5Fpython/datesandtimes.html ) for the fact that it does have lots of dates on it and I want to grab all of them. I don't understand why it is hanging when it doesn't on o...
I have a php variable that comes from a form that needs tidying up. I hope you can help.
The variable contains a list of items (possibly two or three word items with a space in between words).
I want to convert it to a comma separated list with no superfluous white space. I want the divisions to fall only at commas, semi-colons or new-l...
Hi.
I'm trying to find the proper regular expression to convert eregi($1,$2) to preg_match("/$1/i",$2)
i need to consider if there will be functions with () in it, and they may appear more then once.
can anyone please provide the proper regular expression to do so ?
thanks
...
I'm already aware that \w in PCRE (particularly PHP's implementation) can sometimes match some non-ASCII characters depending on the locale of the system, but what about [a-z]?
I wouldn't think so, but I noticed these lines in one of Drupal's core files (includes/theme.inc, simplified):
// To avoid illegal characters in the class,
// w...
Hello everyone, how can i extract the http from this text?
"Text: Here's 2 free bonuses. http://blablabla.blabla/blabla "
But the url can also be another one.
Finaly
After i have the array, wich contains usualy just one url, how can i add it to the above text exactly at the same position? but with html tag <a>
the results should l...
I'm trying to parse some AS3 with the use of Regular Expressions. I cannot, for the life of me, figure out how to omit matches that are inside of string quotations. I need to match test in the variable name testString, but not the test thats between the quotations. I don't want to match anything that's part of any string's content.
var ...
I want to do a MySQL query to get the following effect:
table_column [varchar]
-----------------------
1|5|7
25
55|12
5
3&5
5|11
I want a reliable way to get all the values where 5 is the complete value.
So, for example, if I do a REGEXP query for the number 5 on the upper table I would like to get all ro...
I am trying to convert this:
[img,src=http://www.ANYTHINGHERE.com/image.png,width=55px,height=105px]<br />
To this:
<img src="http://www.ANYTHINGHERE.com/image.png" width=55px height=105px>
(without spaces)
I am trying with this regex:
/(\[img[| |,|]?[(src=(.*)?)|(width=(.*)?)|(height=(.*)?)|,]*)(\])/<br />
But it doesn't fin...
Background: I'm developing a custom regex-like syntax for URL filenames. It will work like this:
User writes a pattern, something like "[a-z][0-9]{0,2}", and passes it as input
It is parsed by the program and translated into the set of permutations it represents i.e.
'a', 'a0', 'a00' ... 'z99'
These patterns will vary in complexity, ...
Hello,
this seems to be an easy task really, but being completely new to the world of programming, I have problems with the following task:
I have a huge file which has the following format:
track type= wiggle name09
variableStep chrom=chr1
34 5
36 7
54 8
variableStep chrom=chr2
33 4
35 2
78 7
this is text with the word random in...
Hi,
I'm trying to work out what regular expression I would need to take a value and replace spaces with a dash (in Javascript)?
So say if I had North America, it would return me North-America ?
Can I do something like var foo = bar.replace(' ', '-') ?
Thanks
...
The pipe symbol | is used in Regular Expression as a sort of 'either' statement, far as I know. Either this, either that, or that, or that, etc...
However, I wish to check a string with a regular expression, for the presence of this symbol. I've tried escaping it, but that doesn't seem to work.
How do I do this, especially if I'm alrea...
Hi,
I need to be able to parse strings like these:
kev-+kvs+-one-+gdl+-greg-+kvs+-two-+gdl+-les-+kvs+-three
-+gdl+-kev-+kvs+-one-+gdl+-greg-+kvs+-two-+gdl+-les-+kvs+-three
kev-+kvs+-one-+gdl+-greg-+kvs+-two-+gdl+-les-+kvs+-three-+gdl+-
and in all three cases recognise these three groups:
kev-+kvs+-one
greg-+kvs+-two
les-+kvs+-th...
I need to create an easy way to split up some strings into formatted strings, for example, i have this string
":[email protected] PRIVMSG #channel :test message"
and i need to split that into:
string nickname = "JStoker"
string ident = "stoker"
string host = "jcs.me.uk"
string channel = "#channel"
string message = "test messa...