Linked Questions

72 votes
7 answers
46k views

I'm not even sure if this is possible or not, but here's what I'd like. String: "NS306 FEBRUARY 20078/9/201013B1-9-1Low31 AUGUST 19870" I have a text box where I type in the search parameters and ...
XstreamINsanity's user avatar
22 votes
7 answers
7k views

i need to parse some data and i want to convert AutomaticTrackingSystem to Automatic Tracking System essentially putting a space before any capital letter (besides the first one of course)
leora's user avatar
  • 198k
15 votes
4 answers
13k views

I am implementing the following problem in ruby. Here's the pattern that I want : 1234, 1324, 1432, 1423, 2341 and so on i.e. the digits in the four digit number should be between [1-4] and should ...
Apoorv Saxena's user avatar
10 votes
6 answers
14k views

How can I get the last integer "56" from String like ra12ke43sh56? I have to modify the next value as ra12ke43sh57 so I want to get the last the integer value.
Rakesh's user avatar
  • 131
3 votes
4 answers
18k views

I am trying to have a regular expression split on equations like 1.5+4.2*(5+2) with operators - + * / so the output would be input into a array so I can parse individually [0]1.5 [1]+ [2]4.2 [3]* [4](...
sutoL's user avatar
  • 1,767
5 votes
3 answers
10k views

Is there a way (other than by doing two separate pattern matches) to use preg_match in PHP to test for either the beginning of the string or a pattern? More specifically I often find myself wanting to ...
frankieandshadow's user avatar
2 votes
3 answers
8k views

I'm trying to write a very simple regular expression that matches any file name that doesn't end in .php. I came up with the following... (.*?)(?!\.php)$ ...however this matches all filenames. If ...
Simon Stevens's user avatar
3 votes
3 answers
3k views

I don't know if this is possible using regex. I'm just asking in case someone knows the answer. I have a string ="hellohowareyou??". I need to split it like this [h, el, loh, owar, eyou?, ?]. The ...
Emil's user avatar
  • 13.8k
3 votes
4 answers
14k views

I want to match following pattern: key="value" key="value" key="value" key="value" ... where key and value are [a-z0-9]+, both should be grouped (2 groups, the " - chars can be matched or skipped) ...
ilann's user avatar
  • 453
5 votes
4 answers
345 views

Here's the code I'm using : public class splitText { public static void main(String[] args) { String x = "I lost my Phone. I shouldn't drive home alone"; String[] result = x.split("."); ...
DM_Morpheus's user avatar
4 votes
4 answers
1k views

In another question I learned how to calculate straight poker hand using regex (here). Now, by curiosity, the question is: can I use regex to calculate the same thing, using ASCII CODE? Something ...
Topera's user avatar
  • 12.4k
2 votes
4 answers
10k views

I need help on following regular expression rules of javascript and php. JS var charFilter = new RegExp("^[A|B].+[^0123456789]$"); PHP if (!preg_match('/^[A|B].+[^0123456789]$/', $data_array['...
knightrider's user avatar
  • 2,603
2 votes
3 answers
2k views

I tried from https://docs.oracle.com/javase/1.5.0/docs/api/java/util/regex/Pattern.html. I have Pattern PATTERN = Pattern.compile("agg{0}.*"); Matcher m = PATTERN.matcher("...
Eyal's user avatar
  • 33
4 votes
1 answer
683 views

We're learning about the difference between regular languages and regex, and the teacher explained that the language a^n b^n is not regular, but she said that most regex flavors can match a^n A^n ...
user282886's user avatar
  • 3,205
2 votes
2 answers
3k views

I'm stuck with an easy regex to match URLs in a content. The goal is to remove the folder from the links like "/folder/id/123" and to replace them with "id/123" so it's a short relative one in the ...
jenny_j's user avatar
  • 21

15 30 50 per page