using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"[\#(/)_\-\=\!\:]";
string input = @"#/usr/bin/python3
from bisect import bisect_right
def binary_search(vector,x):
i = bisect_right(vector,x)
if i != len(vector)+1 and vector[i-1] == x:
return i-1
return -1
def is_prime(vector,number):
return 1 if binary_search(vector,number) != -1 else 0
def prime_vector(num):
ret = []
for a in range(2,num+1):
if a == 2 or a == 3 or a == 5 or a == 7 or a == 11:
ret.append(a)
elif a %2 == 0 or a%3 == 0 or a%5 == 0 or a%7==0 or a%11 == 0:
continue
else:
ret.append(a)
return ret
number = int(input())
prime = prime_vector(number)
ret = []
p = 0
while number:
if is_prime(prime,number):
ret.append(number)
break
elif number%prime[p] == 0:
ret.append(prime[p])
number = int(number / prime[p])
else:
p = p + 1
for a in range((len(ret))):
print(ret[a],end="" "")
";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx