var j = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?\//;
I want to restrict only one / coming at the end of the string. How can I restrict that in the above regular expression?
...
Good programmers keep simple things easy right?
And it's not like the boost documentation makes your life less uneasy...
All I want is an implementation for:
// fulfils the function of a regex matching where the pattern may match a
// substring instead of the entire string
bool search( std::string, std::string, SomeResultType )
So it...
Hi,I've got a string looks like this
ABC(a =2,b=3,c=5,d=5,e=Something)
I want the result to be like
ABC(a =2,b=3,c=5)
What's the best way to do this? I prefer to use regular expression in Python.
Sorry, something changed, the raw string changed to
ABC(a =2,b=3,c=5,dddd=5,eeee=Something)
...
Hi, I've got a string looks like this
String a is "ACdA(a = %b, ccc= 2r2)"
String b is "\ewfsd\ss.jpg"
Expected outputs:
ACdA(a = %b, ccc= 2r2, b_holder = \ewfsd\ss.jpg)
It adds the string b to the end of string a, that's it! But be careful of the ")"
"b_holder " is hard coded string, it's absolutly same in all cases, won't be cha...
I have an issue where I need to find a string in a file, but when I run the regex.match function it returns the string without any text between "<" and ">" missing. Here is my code and the string returned
Original string - [$iif{len("Test")>0,<meta name="Author" content="Test">,""}$]
regex Pattern - \[\$[a-zA-Z_0-9\{\}\(\)<>=\|/\."",...
I have this code to do some ugly inline text style color formatting on html content.
But this breaks anything inside tags as links, and emails.
I've figured out halfways how to prevent it from formatting links, but it still doesn't prevent the replace when the text is [email protected]
$text = preg_replace('/(?<!\.)mytext(?!\/)/', '<spa...
I am trying to make a global search/replace in Eclipse.
I have lines as follow:
<MED:Student id=
<MED:Course id=
<MED:Marks id=
<MED:Attendance id=
Now I need to insert a VAL so it would become:
<MED:Student VAL id=
<MED:Course VAL id=
<MED:Marks VAL id=
<MED:Attendance VAL id=
What would be the proper regular expression that woul...
I'm a novice at regexs and am currently trying to come up with a simple regex that searches for a serial number in the following format: 0217103200XX, where "XX" can each be a numeric digit. I'm using SQL Server Management Studio to pass the regex as a parameter in a stored procedure. I'm not sure if the syntax is any different from ot...
Hi people
if (preg_match_all ("/\[protected\]\s*(((?!\[protected\]|\[/protected\]).)+)\s*\[/protected\]/g", $text, $matches)) {
var_dump($matches);
var_dump($text);
}
The text is
<p>SDGDSFGDFGdsgdfog<br>
[protected]<br> STUFFFFFF<br>
[/protected]<br> SDGDSFGDFGdsgdfo...
Dear Sir
Regular Expression: Not equal to Account and not begin with Account/
How do I express that in a regular expression?
Thank You.
...
I'm using the following line:
$this->validatorSchema['name'] = new sfValidatorRegex(
array('pattern' => '<my_regex>', 'must_match' => false),
array('invalid' => 'Invalid name'));
But "must_match" option is not working and I don't know why. Whatever I use true or false, it works like always: detect the expression and if it's on the te...
I have a text file that contains more or less paragraphs. The text is not actually words, its comma delimited data; but that's not really that important. The text file is sort of divided into sections; there can be sections, and subsections. The division of sections is denoted by more than one newlines and subsections by a newline.
S...
I'm trying to write a regular expression that replaces line feeds between certain areas of a text file, but only on plain text content (i.e. excludes text inside HTML attribute contents, like href) but not having much luck past the first part.
Example input:
AUTHOR: Me
DATE: Now
CONTENT:
This is an example. This is another example. <a ...
Hey guys,
Needing a bit help getting multiple values from a string using Regex. I am fine getting single values from the string but not multiple.
I have this string:
[message:USERPIN]Message to send to the user
I need to extract both the USERPIN and the message. I know how to get the pin:
Match sendMessage = Regex.Match(message, ...
I have some JavaScript that runs uses a replace with regular expressions to modify content on a page. I'm having a problem with a specific regex quantifier, though. All the documentation I've read (and I know it work in regex in other languages, too) says that JavaScript supports the {N}, {N,} and {N,N} quantifiers. That is, you can spec...
Consider the following string which is a C fragment in a file:
strcat(errbuf,errbuftemp);
I want to replace errbuf (but not errbuftemp) with the prefix G-> plus errbuf. To do that successfully, I check the character after and the character before errbuf to see if it's in a list of approved characters and then I perform the replace.
...
Hello guys,
I wanted to get some help on this. I need to take the link that is being pulled in from a feed and extract a portion of the url and then populate it in an img tags src.
html += '<'+ options.titletag +' class="rssRow '+row+'"><a href="'+ entry.link +'" title="View this feed at '+ feeds.title +'">'+ entry.title +'</a></'+ opt...
Hi, I need to do something in regex but I'm really not good at it, long time didn't do that .
/a/c/a.doc
I need to change it to
\\a\\c\\a.doc
Please trying to do it by using regular expression in Python.
...
In python, I've got a string like
ABC(a =2,bc=2, asdf_3 = None)
By using regular expression, I want to make it like
ABC(a =2,bc=2)
I want to remove the parameter that named 'asdf_3', that's it!
Update: The parameters can be a lot, only the asdf_3 is same in all cases, the order is usually the last one.
...
Im new to python and regular expressions. Im searching a file line by line for the occurrence of ##random_string##, and i want to be able to capture the random_string in-between the ##s.
Ive tried both patterns but no luck =/
pattern1=r'[##]()[##]'
pattern2=r'\#{2}()\#{2}'
prog=re.compile(pattern1)
result=prog1.search(line)
if result:...