... 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', ...
... of each line.
function clean_cron_lines() {
while read line ; do
echo "$" |
egrep --invert-match '^($|\s*#|\s*[[:alnum:]_]+=)' |
sed --regexp-extended "s/\s+/ /g" ...
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.