I tried to replace elements in a string using .NET regex - with no luck :)
Assume the following string:
AA A C D A Some Text here
The rules
Do not replace at beginning of line
Do only replace single occurrences
Do not replace if a space is before or after it (optional)
The ...
I'm working in lua, and i need to match 2 parts of a line that's taken in through file IO. I'm inexperienced with regexes and i'm told lua doesn't have full regex support built in (but i have a library that provides that if need be). Can someone help me with building regexes to match the parts necessary?
"bor_adaptor_00.odf" 3.778
...
I want to use a regular expression to find strings which are exactly 10 characters long and begin with "7". Please could someone tell me how?
...
I am using a regular expression to limit words entered in a textbox field to 250-500 words.
(((^\s*)*\S+\s+)|(\S+)){250,500}
Since I know little to nothing about regular expressions, I had copied it from another website. I get the validation error regardless of how many words are entered.
Here is the page that the form is on, if you w...
I want to get a regex which will match a tag in a java comment so I can replace it with a .net comment.
eg I have this:
/**
* Some method description
*
* @param paramName Parameter description
* which may span more than 1 line
* @return return value.
* @throws ExceptionName some exception description
* again may span...
Hi:
I've been learning regex with java.
I wanted to know if it makes sense to use \G while using java's matcher.
I couldn't find any example of \G used with java :(
Doing something like this would not have the same output as using \G?
String a = "Pruebaprueba";
Matcher matcher = Pattern.compile("(\\w)").matcher(a);
while ( matcher.find...
I have this line of code in javascript
var re = (http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?
Usually I encapsulate the regex syntax with the / characters but since they are found within the regex it screws up the encapsulation. Is there another way how I can store it inside the variable...
$str =
preg_replace('#([\x00-\x1F])#e', '"\x" . sprintf("%02x", ord("\1"))', $str);
...
Disclaimer: I'm not a regex expert.
I'm using Python re module to perform regex matching on many htm files. One of the patterns is something like this:
<bla><blabla>87765.*</blabla><bla>
The problem I've encountered is that instead of finding all (say) five occurrences of the pattern, it will find only one. Because it welds all the o...
I need to identify (potentially nested) capture groups within regular expressions and create a tree. The particular target is Java-1.6 and I'd ideally like Java code. A simple example is:
"(a(b|c)d(e(f*g))h)"
which would be parsed to
"a(b|c)d(e(f*g))h"
... "b|c"
... "e(f*g)"
... "f*g"
The solution should ideally account for cou...
hi there,
is there a regular expression to match the content within braces. For example with the following:
d = {'key': {'a': [1,2,3]}}
I would want to match {'key': {'a': [1,2,3]}} and {'a': [1,2,3]}, but not {'key': {'a': [1,2,3]}
...
RewriteRule ^/?page/?([a-zA-Z0-9,-]+)$ $1.php [L]
is it possible for a text editor to find and replace a string in a manner as how apache's mod_rewrite does it? i mean for example, in a text-file, i'd like to enclose all email addresses inside double qoutes,
by inputting [a-zA-Z_]@[a-zA-Z-]+\.[a-zA-Z.]+ in the "find what" field
and "$...
C# Need to locate web addresses using REGEX is that possible?
Basically I need to parse a string prior to loading it into a WebBrowser
myString = "this is an example string http://www.google.com , and I need to make the link clickable";
webBrow.DocumentText = myString;
Basically what I want to happen is a replace of the web address ...
How can I constrain an MVC route parameter to be only A-Za-z and exactly 1 letter? (Looking for the validation Regex). Thank you!
...
I've tried "m" modifier,but not working:
$reg = '/...
/m';
preg_match($reg,...,$match);
EDIT
Or maybe I need a modifier that can ignore white space like ENTER,TAB and so on.
Because when I remove the white space in my regex it works.
EDIT AGAIN:
I need a modifier so that regular expression
"/aaaa b/",
"/aaaa
b/"
are t...
i'm having a string
var str = "hello -- (world)";
using regex and replace
str.replace([a-z],"0");
replaces all the alphabets. but i need to replace other than alphabet.
...
I'm getting full html code using WebClient. But i need to get specified div from full html using regular expression.
for example:
<body>
<div id="main">
<div id="left" style="float:left">this is a <b>left</b> side:<div style='color:red'> 1 </div>
</div>
<div id="right" style="float:left"> main side</div>
<div>
</body>
...
Hi!
I want to route url through Zend route regex with Swedish character
and here is my regex in xml configuration:
.....
([a-z\-å|ä|ö]+)
.....
Still, the route doesn't behave as I expect.
It doesn't redirect when the link contains å, ä, or ö
I have tried to change to [a-zåäö\-]+
but it also gives the same result..
anyone can help? ...
Greetings,
A script is working on one or more files. I want to pass the filenames (with regex in them) as arguments and put them in a list. What is the best way to do it?
For example I would accept the following arguments:
script.py file[1-3].nc #would create list [file1.nc, file2.nc, file3.nc] that I can work on
script.py file*.nc #w...
I want to sort out all APIs in the following text file:
DLL Name: msvcrt.dll
...
DLL Name: msvcrt.dll
...
DLL Name: KERNEL32.dll
...
DLL Name: WSOCK32.DLL
I thought of something like
$infostring = lc($infostring);
while ($infostring =~ /dll name:/g)
{
print "found dll\n";
}
the only problem is, how to get the actual dll names or a...