In my program when I'm using
line.replaceAll("(", "_");
I got a RuntimeException:
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.accept(Unknown Source)
at java.util.regex.Pattern.group0(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)...
hi,
how do i use this code with jquery,
i know it's easy but it doesn't work for me.
document.getElementsByTagName('html')[0].innerHTML.replace(/<!--|-->/g,'')
...
Howdy,
I'd like to return string between two characters, @ and dot (.).
I tried to use regex but cannot find it working.
(@(.*?).)
Anybody?
...
I am trying to write a regex string to match a string revived from an IRC channel.
The message will be in the format "!COMMAND parameters"; the only command that is built by the system so far is repeat.
The regex I am using looks like this:
/![repeat] (.*?)/
When other commands are added it will look like:
/![cmd1|cmd2|cmd3] (.*?)/...
Based on this answer...
http://stackoverflow.com/questions/201323/what-is-the-best-regular-expression-for-validating-email-addresses/201378#201378
Which led me to this site...
http://fightingforalostcause.net/misc/2006/compare-email-regex.php
I'd like to use this regex for email validation for my ASP.NET MVC app:
/^[-_a-z0-9\'+*$^&%=~...
I've got a <textarea> that will be basically a list of names, so I set a function to replace the spaces between the names for a new line.
Now I need to specify that two or more spaces between names are in fact part of the same element.
IE:
John Lucas [[Laurie Vega]] [[Daniel Deer]] Robert
Should turn to
John
Lucas
[[Laurie Vega]]
[[...
Hi, I am new to regex expressions so sorry if this is a really noob question.
I have a regex expression... What I want to do is check if a string matches the regex expression in its entirety without the regex expression matching any subsets of the string.
For example...
If my regex expression is looking for a match of \s*A*\s*, it sho...
What would I make this rule so that you can access it with and without trailing slash?
RewriteRule ^members/([^/]+)$ members.php?id=$1 [L]
...
Sure it's a regular expression's newbie question, I saw it in a program but I can't understand the part of the two backslashes, Does "\\" have a special meaning like \r or \t?
[a-zA-Z]+\\.?
Thank you
...
$string = "MaryGoesToSchool";
$expectedoutput = "Mary Goes To School";
...
Hi!
I've written a regular expression to strip out BBCode tags - it just strips the allowed tags out (for later counting the string length without the tags).
I'm not an expert when it comes to regular expressions - so after an hour I found this pretty much working:
$pattern = "/\[\/?(i|b|u|url(.*?)|list|li)[\]\[]*\]/i";
$stripped = pre...
Hey there, I'm trying to replace a
<blockquote>...</blockquote>
with
>> ...
This is my Code:
var testhtml = 'sdkjhfbs <blockquote>skldfjsfkjghbs\n sdjkfhb ksdbhv isl\n kdjbhdfgkj bs</blockquote>kdjfgnkdfj';
alert(blockquoteConvert(testhtml));
function blockquoteConvert(html) {
return '>>' + html.
replace(/<blockquot...
Hi
I have the following urls:
www.localhost.com
localhost.com
test.localhost.com
How would I match match www or nothing in a regex?
Thanks,
Andy
...
I have these two lines in an old Perl script. When I write the Python equivalent I get all sorts of errors like valueerror: invalid \x escape, and stuff about encoding.
$line =~ s/[^\x{8}-\x{7B}]/ /ig;
$line =~ s/(Û|²|°|±|É|¹|Í)/ /g;
What do I need to do to get them working in Python?
...
How can I match an alpha character with a regular expression. I want a character that is in \w but is not in \d. I want it unicode compatible that's why I cannot use [a-zA-Z].
...
Looking for a one line C# code that would remove repeated chars from a string.
Have done it with a simple loop with look-ahead but like to see a regex soln.
Ex.
input = "6200032111623451123345666"
output = "623262345245"
Thanks.
Lyle
...
Hallo,
I have the following syntax:
@AAAA{tralala10aa,
author = {Some Author},
title = {Some Title},
booktitle = {Some Booktitle},
year = {2010},
month = {March},
booktitle_short = {CC 2010},
conference_url = {http://www.mmmm.com},
projects = {projects}
}
....
I've made the following regular expression:
@[A-Z]*[{][...
I'm using the following regex basically to search for and delete these characters.
invalid_unicode = re.compile(ur'(Û|²|°|±|É|¹|Í)')
My source code in ascii encoded, and whenever I try to run the script it spits out:
SyntaxError: Non-ASCII character '\xdb' in file ./release.py on line 273, but no encoding declared; see http://www.pyt...
I'm experimenting to learn flex and would like to match string literals. My code currently looks like:
"\""([^\n\"\\]*(\\[.\n])*)*"\"" {/*matches string-literal*/;}
I've been struggling with variations for an hour or so and can't get it working the way it should. I'm essentially hoping to match a string literal that can't conta...
Hi folks!
I'm trying to find the latter half of patterns of the following template:
foo/BAR
'BAR' is the one I'm trying to retrieve. I tried with something like:
\b(foo)/([a-zA-Z]+)
This works fine, but this also matches http://foo/BAR - which I don't want.
I also tried
\\s(foo)/([a-zA-Z]+)
but this doesnt match when the lin...