... and display 12.5% instead of 12.50%.
Well there might be a longer solution without using a regular expression (regex), as in check for the decimal point, check each digit thereafter to see if there ...
What
A quick post on how I managed to build a regex to extract all non-numeric characters (all non-digits) from a string.
Why?
I only want the digits/numbers from a string:
v_PaymentTerms = ...
... syntax, add these to a list, and then submit as the subform name, like in the following example (note I have applied a regex to use US/UK numbering format with 2 decimals and thousandth separator, eg. ...
What?
A quick article to remind me of the regex to change a date from the format dd/MM/yyyy to yyyy-MM-dd.
Why?
Irrespective of server, organization or user settings, the date handling can vary. ...
... to parse the data in the appropriate columns was not working as expected.
How?
The quick answer is a regex that will replace any commas between two quotes with a custom string, to be exact:
v_FormattedData ...
What
A more comprehensive post on some other regex (regular expressions) to format values in Zoho.
How?
The following will remove any non-digits:
v_MyString = "Hello World 123";
v_MyFormattedString ...
... error in which case you could probably add another trigger like above but with BEFORE UPDATE ON my_table_name.
Source(s):
Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript ...
... rieve records with foreign characters:
SELECT *
FROM `myTable`
WHERE `myColumn` REGEXP '[^A-Za-z0-9 -()\-.]'
Joomla! Additional
My Joomla website needed the following code to display the ...
...
-- if non-alpha, uppercase next alpha character.
-- if alpha then lowercase subsequent alphas.
-- NON-ALPHA EXCEPTIONS ADDED TO REGEXP (eg. apostrophe)
WHILE (@i 0
BEGIN
...
... REGEXP_LIKE(S_SURNAME, '[^a-zA-Z0-9]')
-- returns all rows where the student surname contains non-alphanumeric characters
-- eg. O'Brien will be returned
SELECT * FROM STUDENTS WHERE REGEXP_LIKE(S_SURNAME, ...
...
-- return all records that contain non-alphanumeric characters
SELECT * FROM myTable WHERE myColumn NOT REGEXP '^[A-Za-z0-9]+$';
-- return all records that are non-alphanumeric but ignore underscores
SELECT ...
... you don't use in your site structure. Slashes and underscores /_ are good (so regexp: /[^a-zA-Z0-9_\/]/). If you allow percents (%) or apostrophes (*) then you are asking for trouble.
Note my redirect ...
... REGEXP '^[A-Za-z0-9]+$' AS AlphaNumeric
FROM
...
Usage
-- Using the ORACLE example
SELECT
Column1,
Column2,
(LENGTH(
TRIM(
TRANSLATE(
:ParameterToCheck,
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', ...
We use cookies to improve your experience on our website. By browsing this website, you agree to our use of cookies. Read more about our Privacy Policy.