-
Notifications
You must be signed in to change notification settings - Fork 4
replaceCharactersNotInPattern
elcapo edited this page Oct 16, 2014
·
3 revisions
replaceCharactersNotInPattern
replaces unwanted characters from a string with a given character.
An example:
- We have this string:
1!2/3·A|B@C#
- This are the characters we accept:
123ABC
- This is the character we want to replace extra characters with:
0
- The example would return:
102030A0B0C0
/* MySQL */
SELECT replaceCharactersNotInPattern(
'1!2/3·A|B@C#',
'123ABC',
'0' ); /* Returns 102030A0B0C0 */
/* JavaScript */
var cleanString = replaceCharactersNotInPattern(
'1!2/3·A|B@C#',
'123ABC',
'0' ); /* cleanString = 102030A0B0C0 */
/* PHP */
$cleanString = replaceCharactersNotInPattern(
'1!2/3·A|B@C#',
'123ABC',
'0' ); /* $cleanString = 102030A0B0C0 */
-
[string]
- After replacing unwanted characters with the new one.
This function is part of the [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN)) package.
Go back home!
SEPA validations
- [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN))
Spanish validations
- NIF, NIE & CIF
- [Spanish Bank Accounts](Spanish Bank Accounts)
Helpers
- [Common functions](Common functions)