Questions tagged [lookbehind]

A lookbehind is a part of the regular expression standard.

385 questions
0
votes
0 answers

RegEx LookBehind for more than one char?

Is there a way in Java, when you use a RegEx look-behind to look for more than 1 character behind? I have this: return str.replaceAll(".(?
Dimitar
  • 4,402
  • 4
  • 31
  • 47
0
votes
1 answer

javascript regex lookbehind and jQuery selector

I am using the following regex in a custom selector in jQuery $.expr[":"].matchRegex = $.expr.createPseudo(function(arg) { return function( elem ) { return $(elem).text().match(new RegExp(arg, 'i')) != null; }; }); However, since…
0
votes
4 answers

Use String for Pattern but Exclude it from Being Removed

i'm pretty new on regex, i have learned something by the way, but is still pour knowledge! so i want ask you for clarification on how it work! assuming i have the following strings, as you can see they can be formatted little different way one from…
Luca Filosofi
  • 30,905
  • 9
  • 70
  • 77
0
votes
0 answers

preg_split regex lookback for multiple matches

The goal of my regex is to split on any unicode whitespace, excluding newline and ensure that that newline character is appended to the previous non unicode whitespace character. Currently I am seeing this work, but only for single whitespace…
Drew
  • 127
  • 2
  • 10
0
votes
1 answer

Regex needed to get text between to words when text starting match appears earlier

I am quite unexperienced in using regex. I have a text like this: This is a demo text I need a special part The text i want to get is here.< The result i need is this : "text i want to get" .So i have to search backwards from "get" to "text" i…
fid200
  • 47
  • 3
0
votes
1 answer

Robot Framework - "Lookaround" regex

I am trying to find a way to get Robot Framework to grab text between known strings in log files. I'd like to use this to grab variables (like IP addresses) to pass them on through my Testplans. Example Logs: (Note the varied timestamps, I have no…
Colin
  • 93
  • 1
  • 3
  • 11
0
votes
2 answers

Java Regex look-behinds

I have the following regular expression (?s)^(?<=.*Exception.*), so basically I want to find any Exception that was thrown before the server starts running. I have a test log file that is supposed to match the…
Ratshiḓaho Wayne
  • 743
  • 1
  • 5
  • 23
0
votes
3 answers

Split string in JavaScript using regex with zero width lookbehind

I know JavaScript regular expressions have native lookaheads but not lookbehinds. I want to split a string at points either beginning with any member of one set of characters or ending with any member of another set of characters. Split before ເ, ແ,…
hippietrail
  • 15,848
  • 18
  • 99
  • 158
0
votes
2 answers

Avoiding Lookbehind in Postgres

In a Postgres query I wrote, I'm trying to find an empty char between a digit and a char. The Raw-Data looks pretty similar to this: "X 1111-11-112222-22-22YY 3333-33-334444-44-44ZZZ5555-55-556666-66-66AAA7777-77-778888-88-88B …
0
votes
6 answers

How to extract data from string using Python RegEx?

I have file names in this format : INC_2AB_22BA_1300435674_218_19-May-2014_13-09-59.121._OK INC_2EE_22RE_1560343444_119_11-Jun-2014_15-21-32.329._OK INC_2CD_22HY_1652323334_312_21-Jan-2014_11-15-48.291._OK I want to extract the name before the…
ThinkCode
  • 7,841
  • 21
  • 73
  • 92
0
votes
2 answers

Regex has problems with poitive lookbehind

I am currently trying to create a regex that strips unecessary quotation marks from HTML tags. The regex will be used in PHP code. converts…
BrainStone
  • 3,028
  • 6
  • 32
  • 59
0
votes
1 answer

What is the RegEx for this match?

I am trying to match the number before the semicolon but I can't use a quantifier in my lookbehind so I have no idea how to make this work. The string (yes, there are tab spaces in between "item[##]" and "=")