I am trying to write this query, I need to select rows where the column has only letters (az) and a full stop.
I tried this, but it did not work:
SELECT * FROM table WHERE (c1 REGEXP '[^a-zA-Z\.]') = 0
This one usually works in PHP.
Try:
SELECT * FROM table WHERE c1 REGEXP '^[a-zA-Z.]+$'
Anchor ^ and $ guarantees the correspondence of the whole line, and not its part. Then the character class [a-zA-Z.] Corresponds to one upper or lower case letter or period. + is a quantifier for one or more repetitions of the previous sub-mode, so in this case it allows us to match one or more periods or upper / lower case letters.
^
$
[a-zA-Z.]
+
Additional Information on Using Regular Expressions in MySQL
Source: https://habr.com/ru/post/1434367/More articles:faster way to process a time string using python - pythonSubject 1: EXC_BAD_ACCESS (code = 1, address = 0x30000008) there was a problem - iosHow can I start a UITableView section with number 0 when I have multiple sections? - iosFlash in Gmail to upload files - javascriptfiltering switches in jquery, comparing values - jqueryGiven a sorted array, find the maximum subarray of duplicate values - algorithmrewriting a subclass in python - pythoniOS app with basic data, photos and iCloud - iosFile RestKit / RestKit.h not found. - iosProblem with UnboundLocalError using Python's Dropbox API - pythonAll Articles