equivalent for regexp /<rr>(.*?)</rr>/<test>$1</test>/gi
I want to write simple program in C equivalent to the regular expression: /<rr>(.*?)<\/rr>/<test>$1<\/test>/gi. Does anyone have examples? ...
I want to write simple program in C equivalent to the regular expression: /<rr>(.*?)<\/rr>/<test>$1<\/test>/gi. Does anyone have examples? ...
We have a lot of data that contains nasty MS Word formatting like this: <!--[if !mso]> <mce:style><! v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} --> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:Tr...
Hi, I am trying to parse FSM statements of the Gezel language (http://rijndael.ece.vt.edu/gezel2/) using Python and regular expressions regex_cond = re.compile(r'.+((else\tif|else|if)).+') line2 = '@s0 else if (insreg==1) then (initx,PING,notend) -> sinitx;' match = regex_cond.match(line2); I have problems to distinguish if and els...
I seem to remember that there were certain conditions under which $ would match a newline (not "just before"), but I can't find anything in the docs that would confirm that. Did that use to be true in an earlier version of Perl or am I dreaming? ...
I sometimes want to match whitespace but not newline. So far I've been resorting to [ \t] . Is there a less awkward way? ...
So I'm trying to a parse a file that has text in this format: outerkey = (innerkey = innervalue) It gets more complex. This is also legal in the file: outerkey = (innerkey = (twodeepkey = twodeepvalue)(twodeepkey2 = twodeepvalue2)) So I want to basically capture only the outerkey's text. I cannot guarantee that all of the text wi...
Basically I want to do the same as here which is done in Python. I'd like to replace all self-closed elements to the long syntax. Example <iframe src="http://example.com/thing"/> becomes <iframe src="http://example.com/thing"></iframe> Full example: <html> <head> <meta http-equiv="Content-Type" content="tex...
I need to write some Javascript to check an input to only allow number and letter and '-' and '_' and space bar. Here is my regular expression var pattern = /^([a-zA-Z])([a-zA-Z0-9_-]){1,80}$/; Above regex does not include space bar. How can I add space bar condition into my regex. ...
I want to add an automatic embedding feature when a YouTube URL is used (http://www.youtube.com/watch?v=VID, where VID is the video's ID). For this, I need to check if the given URL, stored in the variable url, matches "/http:\/\/www\.youtube\.com\/watch\?v=([a-z0-9]+).*/i", then I need to strip out the VID to use it (e.g. put the VID i...
I'm writing a PHP script that autoconfigures a device over Telnet, and I need to grab some IP addresses from /etc/hosts I need it to grab the IP address only, and assign it to a variable based on the hosts name. Example: 192.168.1.50 machine 192.168.1.51 printer 192.168.1.52 sigpad The PHP script should be like this: $machineip = "1...
Does anyone know what the preg in preg_match, preg_grep, etc. stand for? I know they use PCRE, which are 'Perl Compatible Regular Expressions.' ...
I have the problem that I can only use one Regex.IsMatch to validate a string and I have to conditions with regular expressions to be matched for the same string, I've looking and seems that I can use regex conditionals like (?(?=regex)then|else) to match both regular expressions on the string value, but I can't reach the same result My...
I'm trying to write a regular expression that will essentially return true if string A is found and string B is not found. To be more specific, I'm looking for any file on my server which has the text 'base64_decode' in it, but not 'copyright'. Thanks! ...
We have a non normalized table that contains foreign key infomration as free text inside a column. I would like to create a view that will transform and normalize that table. E.g. a column that contains the following text: "REFID:12345, REFID2:67890" I want to create a view that will have REFID1 and REFID2 as 2 separate integer colu...
So I have sed running with the following argument fine if I copy and paste this into an open shell: cat test.txt | sed '/[,0-9]\{0,\}[0-9]\{1,\}[acd][0-9]\{1,\}[,0-9]\{0,\}/{N s/[,0-9]\{0,\}[0-9]\{1,\}[acd][0-9]\{1,\}[,0-9]\{0,\}\n\-\-\-//}' The problem is that when I try to move this into a korn shell script, the korn shell throws er...
I need a regex to match all self-closing <input /> tags which lacks a type attribute. For example, I want to find these: <input size="1" /> <input name="test" /> But not this: <input type="radio" /> Please note, this should be adaptable for any single attribute. I am just using type here as an example. FYI, I am performing a sear...
I want to validate a some C# source code for a scripting engine. I want to make sure that only System.Math class members may be referenced. I am trying to create a regular expression that will match a dot, followed by a capital letter, followed by any number of word characters, ending at a word boundry that is NOT preceded by System.Ma...
Been trying to come up with a regex in JS that could split user input like : "Hi{user,10,default} {foo,10,bar} Hello" into: ["Hi","{user,10,default} ","{foo,10,bar} ","Hello"] So far i achieved to split these strings with ({.+?,(?:.+?){2}})|([\w\d\s]+) but the second capturing group is too exclusive, as I want every character to be...
Consider the below Case 1: [Success] Input : X(P)~AK,X(MV)~AK Replace with: AP Output: X(P)~AP,X(MV)~AP Case 2: [Failure] Input: X(P)~$B,X(MV)~$B Replace with: C$ Output: X(P)~C$,X(MV)~C$ Actual Output: X(P)~C$B,X(MV)~C$B I am using the below REGEXP @"~(\w*[A-Z$%])" This works fine for case 1 but falied for the second. Ne...
Hi folks, I my application I am using below regex for pattern matching. Original Pattern : /(\w+\.){2,}/ig Above pattern added in one array. Since this pattern has comma ( , ) after 2, creating problem in some environment. As we know below concept in regex : {n} - matches n times {n, m} - matches at least n times, but not mor...