Questions tagged [xregexp]

XRegExp provides augmented, extensible JavaScript regular expressions.

XRegExp provides augmented, extensible JavaScript regular expressions. It adds new syntax, flags, and methods beyond what browsers support natively. XRegExp is also a regex utility belt with tools to make client-side grepping simpler and more powerful, while removing cross-browser inconsistencies.

XRegExp supports all native ES5 regular expression syntax. It works in browsers and on the server using Node.js. It can additionally be loaded as a RequireJS module.

77 questions
12
votes
2 answers

Javascript unicode (greek) regular expressions

I would like to use this regular expression new RegExp("\b"+pat+"\b") in greek text but the "\b" metacharacter supports only ASCII characters. I tried XregExp library but i didnt manage to solve the issue. Any suggestions would be greatly…
kylito
  • 121
  • 1
  • 4
9
votes
2 answers

Chrome: Uncaught Error: can't load XRegExp twice in the same frame

The following code will fail in both of my chromes on 2 different computers (Windows 7 both of them, Chrome 12.0.742.100).
h2ooooooo
  • 36,580
  • 8
  • 61
  • 97
5
votes
2 answers

Using XRegExp.matchRecursive for nested spans

I want to achieve a way to get all the content between one open span tag and it's close tag. The problem is that sometime I can have nested span and I want to be sure that my regex don't stop a the first ending span it see. To see my problem look at…
Ganbin
  • 1,523
  • 1
  • 10
  • 19
5
votes
4 answers

How to use whole word regex search for Devanagari text?

My HTML code with Devanagari words TODO मंत्री मुख्यमंत्री
4
votes
2 answers

Javascript regular expression for searching word boundaries in Unicode string

Is there solution to find word boundaries in Japanese string (E.g.: "私はマーケットに行きました。") via JavaScript regular expressions("xregexp" JS library cab be used)? E.g.: var xr = RegExp("\\bst","g"); xr.test("The string") // --> true I need the same logic…
Andrei
  • 4,137
  • 3
  • 23
  • 29
4
votes
4 answers

Remove String Between Substring from RegExp

I write this code for remove string from 'a' to 'c' var str = "abcbbabbabcd"; var re = new RegExp("a.*?c","gi"); str = str.replace(re,""); console.log(str); The result in console is "bbd" But the result that right for me is "bbabbd" Can I use…
4
votes
2 answers

XRegExp no look-behind?

I need to use lookbehind of regex in JavaScript, so found Simulating lookbehind in JavaScript (take 2). Also, I found the author Steven Levithan is the one who developed XRegExp. I git cloned XRegExp 3.0.0-pre, and tested some lookbehind…
user1028880
3
votes
2 answers

RegEx for matching Cyrillic, numbers, space and some special chars (- \ , :

I do have the following RegExp in the current web application. function myCyrillicDigitsAndSpaceValidator(text){ return XRegExp("^[\\p{Cyrillic}0-9]+").test(text); } As you can see I use XRegExp javasciprt library. Currently, this regxep checks…
Daler
  • 1,175
  • 3
  • 14
  • 36
3
votes
2 answers

xregexp having different result

I want to validate string with rules: string must contain at least one letter string can contain only those symbols(but it's not a must): ' , - , ( , ) if there is a symbol present in the string, it must also contain a letter(at least one 1st…
3
votes
1 answer

Regular expressions - Replacing with XRegExp

I have a feeling this is going to be a stupid question, but I'm completely baffled. I'm using the XRegExp library for Javascript to generate a regular expression that matches any word in any alphabet, and does not match words with numbers,…
Emma
  • 265
  • 1
  • 3
  • 13
2
votes
1 answer

IE bug with SyntaxHighlighter and jQuery - "Unable to get value of the property 'slice': object is null or undefined"

I really love SyntaxHighter - it turns out the poshest looking code around. Unfortunately I've barked my shins against an appalling JS error in IE7 and IE8 which is going to prevent me using this otherwise excellent plugin altogether. Here's a test…
And Finally
  • 5,190
  • 14
  • 63
  • 101
2
votes
1 answer

How to get correct first letter in a tamil unicode word using Javascript?

Edit 2: const tamilRegex = XRegExp("\\p{Tamil}", "ug") const match = XRegExp.exec(word, tamilRegex); return match Now, I found XRegExp a library which can handle unicode characters. The above code is the one I tried using that library still it…
2
votes
1 answer

RegExp to stop matching after a certain string

I am looking for a RegExp to stop matching after a certain keyword. This is my Input: blabl texta 1,40 textb 3.50 textc 6,90 blabal 2 3 ddd 3 jj d key textd textf 2,30 4,70 5,90 What I want to match: blabl texta 1,40 textb 3.50 textc 6,90 blabal…
Th0rne
  • 35
  • 5
2
votes
1 answer

XRegExp for email address

I want to write regular expression for email address for all including non-italic characters. I tried but it return false Please provide correct solution as soon as possible