Category "regex"

Regex returning a value in IE, 'undefined' in Firefox and Safari/Chrome

Have a regex: .*? (rule1|rule2) (?:(rule1|rule2)|[^}])* (It's designed to parse CSS files, and the 'rules' are generated by JS.) When I try this in IE, all

Convert currency string to decimal PHP

I need convert a currency string to decimal for storage it in a database of type "decimal (9,2)". Example: 0 => 0.00 1 => 1.

Remove insignificant trailing zeros from a number?

Have I missed a standard API call that removes trailing insignificant zeros from a number? var x = 1.234000; // to become 1.234 var y = 1.234001; // stays 1.234

Problem with quantifiers and look-behind

### Ruby 1.8.7 ### require 'rubygems' require 'oniguruma' # for look-behind Oniguruma::ORegexp.new('h(?=\w*)') # => /h(?=\w*)/ Oniguruma::ORegexp.new('(?&

How to cache the compiled regex in Go

Below is my golang code. Each time validate method is called my compile method gets executed. I want to compile only once, not each time we call validate. 1)

How to use REGEXEXTRACT for day and time?

I am using a third-party app that allows me to log in my day, time and location at the push of a button, on a google sheet. (source: imggmi.com) While the app c

How to use regular expressions do reverse search?

For example: My string is: 123456789 nn nn oo nn nn mlm nn203. My target is: nn. Then, I match string from the end to the beginning and return the first ma

Replace unicode space characters

I need to replace the unicode characters defined on here I have got this so far but it seems to remove all space including standard spacebar ones: var str = "

Replace unicode space characters

I need to replace the unicode characters defined on here I have got this so far but it seems to remove all space including standard spacebar ones: var str = "

Replace unicode space characters

I need to replace the unicode characters defined on here I have got this so far but it seems to remove all space including standard spacebar ones: var str = "