Swift 4 regex custom validation [duplicate] - swift

This question already has an answer here:
Learning Regular Expressions [closed]
(1 answer)
Closed 4 years ago.
i need some help to write correct regex validation. I want password with no spaces, min. 6 symbols, doesn't matter numbers or letters or symbols. Alphabet a-zA-Z and а-яА-Я(RU). How i can do that?

"^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{6,}$"
You can take a look at this link

Related

How to generate Random Numeric String having 6 digits in Gatling? [duplicate]

This question already has answers here:
Assured 6 digit random number
(8 answers)
Closed 1 year ago.
I am new to Gatling and Scala Environment.
How to generate a Random Numeric String having 6 digits, in Gatling?
For example, I need to feed "123456" for an attribute in Gatling.
Thanks for the help.
You could start with what you've got and make the following change...
...filter(_.isDigit).take(6).mkString
...but I'd be more inclined toward the following.
(Random.nextInt(900000)+100000).toString
Note: For the 1st proposed solution, leading zeros are possible, "010203" for example. That's not the case for the 2nd. Not sure which is preferred.
Scala 2.13.x option:
util.Random.between(100000, 1000000)
//minimum (inclusive)--^ ^--maximum (exclusive)

I would like to use a dollar sign in a flutter, how can I do this? [duplicate]

This question already has answers here:
Special characters in Flutter
(6 answers)
Closed 2 years ago.
I would like to use a dollar sign in a flutter, how can I do this?
like this:
Text('$21.99')
Use Escape Sequence Character,
Text('\$21.99')
You can use raw string by suffixing r.
Like this
Text(r'$21.99')

Swift Prevent Emoji Representation of Unicode Character [duplicate]

This question already has an answer here:
Inconsistent Unicode Emoji Glyphs/Symbols
(1 answer)
Closed 6 years ago.
I want to print the unicode character U+21A9 which is the undo arrow (↩), but Apple likes to turn that in a bubbly looking emoji like
Pick a font containing the glyph that you want, like Lucida Grande or Menlo.

See what characters are in an NSCharacterSet [duplicate]

This question already has answers here:
NSArray from NSCharacterSet
(9 answers)
Closed 7 years ago.
When I'm trying
print(NSCharacterSet.URLQueryAllowedCharacterSet())
it prints
<__NSCFCharacterSet: 0x1759b900>
How do I make it more informative?
You can get a representation of the character set using bitmapRepresentation which could be queried. Or you could do basically the same thing with a loop over all characters and using characterIsMember:. The output is potentially big...
There isn't really a simple option or a generic concise output to what you're asking for. It isn't a common requirement.

How to eregi_replace to preg_replace [duplicate]

This question already has answers here:
How can I convert ereg expressions to preg in PHP?
(4 answers)
Closed 8 years ago.
eregi_replace('[0-9]+\.+[0-9]','',$cart['unit']);
How to change it to preg_replace?
I get an error: Warning: preg_replace() [function.preg-replace]: Unknown modifier '+' in ---
You can use your existing Regex almost unchanged in a preg_replace(). Just add delimiters and a case-insensitive modifier. You get
preg_replace('#[0-9]+\.+[0-9]#i','',$cart['unit']);
In fact, the case-sensitivity is irrelevant since your pattern only matches 0-9 and .