Ruby:
/qweqwe/.to_s
Regexp, Regexp, String, Regexp #to_s. , ., :
( (? opts: source). Regexp:: new , .
, Regexp #inspect, :
rxp.
/ab+c/ix.inspect #=> "/ab+c/ix"
:, Regexp String, , , . , ( , #split), grep :
array = "test,ab,yr,OO".split( ',' )
# => ['test', 'ab', 'yr', 'OO']
array = array.grep /[a-z]/
# => ["test", "ab", "yr"]
:
array.join(',')
# => "test,ab,yr"
#scan :
"test,ab,yr,OO".scan( /[a-z]+/ )
# => ["test", "ab", "yr"]
, , , , , ruby-string-random. :
Regexp.
:
pattern = '[aw-zX][123]'
result = StringRandom.random_regex(pattern)