Hi, actualy i have a very complex problem, but i have narrowed it down here to the most essential part with some dummy-data.
Say i have the folowing text:
a
aa
aaa
aaaa
aaaa
aaaaa
a
aa
aaa
aaaa
aaaaa
aaaaaa
aaaa
a
What i would like to do is, FOR EXAMPLE when a line of 4 a's is followed by a line of 1 a. I'd like to add a line of 3 a'...
I'm trying to verify that a filename and path input by the user is structurally correct in a C# GUI. I do not need to make sure the file exists, just that the name is a valid windows file name and the path is a valid relative path from the present working directory. Absolute paths must be explicitly denied. Regex was never my thing.
A...
Hi,
I'm trying to parse a JSON using Grails, to test the parser I Wrote an unit test and put my input JSON in a GString that looks something like this:
"""{"Information":"Some data here \"stuff\" some more.","AnswerToEverything":42,"Other":71,"Name":"Joe Doe"}"""
The \"stuff\" is causing the parser to break.
I tried using String.rep...
Need help finding or having a RegEx match a MM/YY or MM/YYYY format. My RegExFu is weak and I'm not even sure where to begin writing this.
Months should be 1-12, years, well anything beyond 2009 should be valid. Sorry for not mentioning more details before. This is used as an expiration date.
I'll add a bounty for whomever goes ab...
I have big string, it can have a few thousands lines. I would like to to get all sub-strings like: [tag] here can be everything [/tag] in a list.
How can I do this? My regex is not working (or I'm doing something wrong).
...
I need to find the most optimal solution using Regex to find URL's inside a block of HTML and add a new attribute Name="true" inside the tag.
Below is an example of HTML (which can contain embedded JS), I just need to add the new attribute Name="true" to any URL and NOT effect any embedded JS file.
Example HTML :
<HTML>
<a href...
NOTE: This is not a simple string replace question.
SomethingBlahBlah can be #SomeThingOtherthanThis
My case is as follows, I have a large string (<1024B, but >300B), that will have {#String} and {$String}.
To be more specific {#SomethingBlahBlah} and {$SomeOtherThingBlahBlah}, so in regexp {#w+} and {$w+}
My first question is, are r...
I need help using regular expressions using Find and Replace in VS2010. I want to
Find request("somevar") and replace it with html_encode(request("somevar"))
somevar will be a different for each request("")
Thanks.
...
Hi, I am still a beginner with Perl, so please bear with me. This is the situation I'm experiencing:
$var = "AB1234567";
$num = "1234567";
next if $var =~ /$num/;
print "Success!\n";
Now, my understanding is that it should print "Success!\n", but in reality it doesn't. However, if I change the regex to next if $var =~ /"$num"/;, this...
What is this regex supposed to do, because it keeps giving back null?
var klass = this.rel.match(/facebox\[?\.(\w+)\]?/)
I thought it was extracting extra words from the rel attribute?
thanks, Richard
...
I am given a string that has place holders in the format of {{some_text}}. I would like to extract this into a collection using C# and believe RegEx is the best way to do this. RegEx is a little over my head but it seems powerful enough to work in this case. Here is my example:
<a title="{{element='title'}}" href="{{url}}">
<img border=...
I have a pattern
ab 23 cde 25 ... and so on
Can I capture the above pattern like
array(
[patterns] => array(
[0] => array(
[payer] => 'ab'
[amt] => 23
)
[1] => array(
[payer] => 'cde'
[amt] => 25
)
)
)
Is this possible?
...
I need to format the followin string
name[Name], emloyeeno[Employee Number], joindate[Date Of Join:dd MMM yyyy], email[EMail]
as
name, employeeno, joindate, email
I'm trying to use a regular expression to resolve this, I best I could come up with is
/\[.*]/g
But it is not resolving the problem, I've a sample created here.
Ca...
I have a table with the following values:
ID NAME ADDRESS
1 Bob Super stree1 here goes
2 Alice stree100 here goes
3 Clark Fast left stree1005
4 Magie Right stree1580 here goes
I need to make a query using LIKE and get only the row having stree1 (in this case only get the one wit...
I have the string R.E.M. and I need to make it REM
So far, I have:
$('#request_artist').val().replace(".", "");
...but I get RE.M.
Any ideas?
...
I'm just a noob when it comes to regexp... I know Perl is amazing with regexp... and I dont know much Perl. Recently started learning JavaScript and came across regex for
validating user inputs... haven't used them much.
How does JavaScript regexp compare with Perl regexp? Similarities and differences? Can all regexp(s) wriiten in ...
I have a template where I want to replace certain regions. In my example below, I want to extract the regions between the ... comments, manipulate it, then replace them back after the manipulation.
I do not need the logic to merge the fields, but I need to extract the regions so I can use my logic and place it back into the template.
...
I have a text input field for titles of various things and to help minimize false negatives on search results(internal search is not the best), I need to have a REGEX pattern which looks at the first four characters of the input string and removes the word(and space after the word) _the _ if it is there at the beginning only.
For examp...
I have a title on a blog goes like this Main Idea, key term, key term, keyterm
I want the main idea and the key terms to have a different font sizes. First thing that came to mind was to search for the first comma and the end of the string and replace that chunk with the same thing but surrounded by span tags with a class to make the fo...
I can't figure out a regex that will grab every word besides MD5 hashes. - I'm using [a-zA-Z0-9]+ to match every word. How do I augment that so that it ignores something I'm thinking is like [a-fA-F0-9]{32} which would match the MD5 hashes. My question regards Regex.
8e85d8b3be426bc8d370facdb0ad3ad0
string
stringString
63994b32affec18c2...