regex's questions - English 1answer

188.757 regex questions.

I have sample function for searching words from array with specified letters: public static function getWords($words, $specifed_letters) { $pattern = is_array($specifed_letters) ? '/[' . ...

How would I go about detecting if all alphabetic characters in a string (of >= 2 characters) are upper case? Here's what I'm trying but doesn't work: library(dplyr) library(stringr) str_detect("THE ...

I have the following json document: { "videoUrl":"", "available":"true", "movie":{ "videoUrl":"http..." }, "account":{ "videoUrl":"http...", "login":"", "...

I have a dataframe with 3 columns as below I/p dataframe A = c("(0_22),(0_25),(1_29)","(1_34),(1_38),(0_40)","(0_07),(0_09),(0_10),(0_13)","(1_47),(1_49),(1_53),(1_57)") zero =c(5,NA,6,NA) ...

I want at first to read lines from the file, rewrite text to another file File dir = new File("C:/Users/PC/workspace/uplo/"); The File I got: String source = dir.getCanonicalPath() + File....

I have a messy bulk of data that I would like to extract information from. Now, I have not quite found a convenient way to extract the information and I hope you can help. My data looks like this: "\...

Key value pair - regex

1 answers, 32 views regex
I have a long text with key value pairs separated by a character '•' (ascii 7) The key must be english letters, digits, and underline - and the value can be everything (also ascii that are not letters)...

How can I emulate the SQL keyword LIKE in JavaScript? For those of you who don't know what LIKE is, it's a very simple regex which only supports the wildcards %, which matches 0 or more characters, ...

I'm trying to create an s3 bucket through cloudformation. I tried using regex ^([0-9a-z.-]){3,63}$, but it also accepts the patterns "..." and "---" which are invalid according to new s3 naming ...

Is it possible? I think yes but I can't reach it. I want the set be : a/ or a or a/word but not ac/ or ac or ... my code: /(a|b)[\/]?/

I need to create a reg expression that validates US phone numbers. The country code is optional as well as parenthesis around the area code. So far I have this /^[1]?[-. ]?\(?([0-9]{3})\)?[-. ]?([0-...

Currently I am using the RegExp (?:\(\) => (.*)|return (.*);) for a custom nameof function that is called like this: nameof(() => myVariable). Depending on the execution though the lambda is ...

My regex is horrendous. I have list items that look like this device = ['1U1abc'] device = ['18U12def'] I want to split the item out that it will look like this device = ['1','U1','abc'] device = [...

function addTotal(checkValue, openAmount) { if(checkValue) totalOpenAmount += openAmount; else totalOpenAmount -= openAmount; if(blnUpdateCheckAll) ...

I want to match regular expression for multiple emails separated by comma, I want to match: abc123@gmail.com,xyz56_@gmail.co.in It should match both email id's. On the other hand, It should not ...

I'm trying to write a mod_rewrite rule to do the following: Request URL: https://dev.website.com/user/name to work as https://dev.website.com/foo/bar/user/name This is my current .htaccess ...

I think this is a simple thing for a lot of you, but I have a very limited knowlegde of regex at the moment. I want to match everything except a double digit number in a string. For example: ...

I am trying to extract string inside the website url however urls are not consistent as they come from different data sources and pretty untidy Examples: www.abcd.com www.ghi khll.in In trying to ...

I just read about Regexp.match?('string') for Ruby 2.4 and was very excited to see the results! But when I tried it out in my application, I hardly saw any gains. str = 's' Benchmark.bm do |b| b....

I'm writing a program to normalize csv header columns. It might occur that the column contains a non-English character, so I added the re.UNICODE flag to my re.sub calls. My code looks like this: ...

I need to learn how to design a DFA such that given any number 'n', it accepts binary strings { 0 ,1 } whose decimal equivalent number is divisible by 'n'. There will be different DFAs for different '...

I need to remove the text from the lines that contain a specific string using batch processors: SED, AWK, Windows batch, Unix shell or something similar. If the string is "green" then the following ...

What is the Java equivalent of JavaScript's String.match() I need to get an array or a list of all matches Example: var str = 'The quick brown fox jumps over the lazy dog'; console.log(str.match(/e/...

I need to form the regex using allowedPattern, MinLength, and MaxLength properties from below JSON. I am using grouping and it working fine. 1) "DomainNetBIOSName" : { "Description" : "NetBIOS ...

Match second instance

4 answers, 60 views c# regex match
I have a string like this, and I only want to find if it contains 'N2' in it, but not 'EN2', so that should be disregarded: EN2T65G872N2ULKJJDLO05 It always would start with EN2 at the beginning, if ...

I have to detect whether a string contains any special characters. How can I check it? Does Swift support regular expressions? var characterSet:NSCharacterSet = NSCharacterSet(charactersInString: "...

I have for example the following RegEx defined: [\d+]{4}\.[\d+]{3}\.[\d+]{3}\s\s(([\w][.])+\s[\w]+).* 1111.111.111 A.A.A. GEK-HENK 00 20 01 AFV 2018-06-30 22 ...

I have found very similar posts but I can't quite get my regular expression right here. I am trying to write a regular expression which returns a string which is between two other strings. For ...

I have two files that will always hold different strings, I want to know a way to print out everything in those two files and highlight only the differences between them. $cat file1.txt fox:1 bike:3 ...

I'm creating a visualization in Shiny based on the 'movies' dataset. In the dataset, among others, for each movie there is an attribute plot_keywords (format is murder|crime|police|man|detective - 5 ...

Given a text : start_KA03MM7155_RKMS121MI4-4.21005_NEW_end, 2018-01-02 09:48:23. How do i extract 2018-01-02 as 020118 in a variable and 09:48:23 as 094823 in another variable using python?

I have seen several other StackOverflow posts such as this one: How to Use/Enable (RegExp object) Regular Expression using VBA (MACRO) in word on using regular expressions in Microsoft Word with VBA ...

I am a beginner to python and I have a log file which I need to take date time. I use regex for taking the 2 conditions but unfortunately my result is not as expected, this is the result I got: Date ...

I have a set of batch commands that I'm trying to convert to shell so I can use them on my linux environment. The command should read rcontrib -y < view\inside_NE.rays -o result/%%04d_inside In ...

Add spaces before Capital Letters

29 answers, 60.255 views c# regex string
Given the string "ThisStringHasNoSpacesButItDoesHaveCapitals" what is the best way to add spaces before the capital letters. So the end string would be "This String Has No Spaces But It Does Have ...

If I pass PHP variables with . in their names via $_GET PHP auto-replaces them with _ characters. For example: <?php echo "url is ".$_SERVER['REQUEST_URI']."<p>"; echo "x.y is ".$_GET['x.y']....

When I write a regular expression like: var m = /(s+).*?(l)[^l]*?(o+)/.exec("this is hello to you"); console.log(m); I get a match object containing the following: { 0: "s is hello", 1: "s", ...

I want to use Regular expression extractor to extract data from HTML body, but I'm new at Regular expression and I don't really understand how it works. I want to extract bb079382-e3e3-430d-a34e-...

I've got the following lines in my log that I want to exclude, so I wanted to use a regexfilter to do so: [INFO ] 2018-05-20 14:52:15.993 [qtp22844606-20] TimingFilter - Request time: 16 ms [INFO ] ...

I am doing an assignment where I need to scrape information from live sites. For this I am using https://www.nintendo.com/games/nintendo-switch-bestsellers, and need to scrape the game titles, prices ...

I am receiving exception message in java, I need exception code of exception message. Example in below string i need to extract only 535-5.7.8 as output 535-5.7.8 Username and Password not ...

I have the following String inputs: 4 Mar to 31 Oct 2015 24 Oct 2015 In both cases I need to extract the first date using the format dd MMM yyyy In the example above, the expected results should ...

I have to check strings in Japanese that are encoded in double-byte characters (naturally the files aren't in Unicode and I have to keep them in Shift-JIS). Many of these strings contain digits that ...

I have a Pandas column contains string like this: (15:38) Hello, how are you? (15:39) I am fine. (15:40) That's good. I want to separate the string by the time mark so I used regex: r'\(\d{1,2}:\d{...

I have created JTable row filter, which is working well and filtering rows according to typing in JTextfield, but it filters according to typed character present anywhere in the row whereas I want to ...

I am working with a segmentation tool that need a specific rule to match in order to split the text into several segments. In order to set a rule that will segment the text only if its length is more ...

So I'm dealing with fairly complex regular expressions in VBA. Horray for me. Lookbehind isn't supported AT ALL in VBA. Fine. One potential hack is to say "The string starts at position X", and ...

I have this regex on Javascript var myS = "00 - ??:??:?? - a"; var removedTL = myS.match(/^(\d\d) - (\?\?|10|0\d):(\?\?|[0-5]\d):(\?\?|[0-5]\d) - (.*)/); and I need to return "false" if myS is not ...

I'm pulling my hair out over this... suppose I have the following string: "123abc" and want to regex it in python 2.7. If I do: import re s = "123abc" m = re.search('[0-9]*', s) print(m.group(0)) it ...

I actually have this case where I have to verify if there's an overlapping pattern (may it be regex or something else). string pattern = "123*" string[] patterns = new string[] { "123?", "123*", "12?...

Related tags

Hot questions

Language

Popular Tags