<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace WifiManager
{
	/// <summary>
	/// This class is used to get info about the available network profiles,
	/// on the current machine and the profiles stored in the ./data/conf directory
	/// </summary>
	class ProfileInfo
	{
		public List<String> getStoredProfileList()
		{
			// TODO: Remove interface name and file extension
			List<String> returnBuilder = new List<String>();
			foreach(string s in IOHandler.getStoredConfigFileNames())
			{

			}

			return IOHandler.getStoredConfigFileNames();
		}

		/// <summary>
		/// Gets the output from getNetshWlanProfiles() uses regex to get the network profile names, 
		/// and returns a list of the available network profiles on the current machine
		/// </summary>
		/// <returns>A string list with network profile names</returns>
		public List<String> getLocalProfileList()
		{
			// Get the netsh wlan profiles
			string netshOutput = getNetshWlanProfiles();
			List<string> wifiList = new List<string>();

			// Find all the AP names and put them into the wifiList
			// TODO: Check if the regex works with multiple profiles, I only had one profile on my machine
			MatchCollection matches = Regex.Matches(netshOutput, @"(?::\s)(\w+)", RegexOptions.IgnoreCase);
            foreach (Match m in matches)
			{
				wifiList.Add(m.Groups[1].Value);
			}
			// Return a list with no duplicate profiles
			// In case of multiple Wifi cards
			return wifiList.Distinct().ToList();
		}
<commit_msg>Added regex to remove interface name and file extension from the stored network profiles<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace WifiManager
{
	/// <summary>
	/// This class is used to get info about the available network profiles,
	/// on the current machine and the profiles stored in the ./data/conf directory
	/// </summary>
	class ProfileInfo
	{
		public List<String> getStoredProfileList()
		{
			List<String> returnBuilder = new List<String>();
			foreach(string s in IOHandler.getStoredConfigFileNames())
			{
				Match match = Regex.Match(s, @"(?:^\w+-)(\w+)(?:\.xml$)", RegexOptions.IgnoreCase);
				returnBuilder.Add(match.Groups[1].Value);
			}

			return returnBuilder;
		}

		/// <summary>
		/// Gets the output from getNetshWlanProfiles() uses regex to get the network profile names, 
		/// and returns a list of the available network profiles on the current machine
		/// </summary>
		/// <returns>A string list with network profile names</returns>
		public List<String> getLocalProfileList()
		{
			// Get the netsh wlan profiles
			string netshOutput = getNetshWlanProfiles();
			List<string> wifiList = new List<string>();

			// Find all the AP names and put them into the wifiList
			// TODO: Check if the regex works with multiple profiles, I only had one profile on my machine
			MatchCollection matches = Regex.Matches(netshOutput, @"(?::\s)(\w+)", RegexOptions.IgnoreCase);
            foreach (Match m in matches)
			{
				wifiList.Add(m.Groups[1].Value);
			}
			// Return a list with no duplicate profiles
			// In case of multiple Wifi cards
			return wifiList.Distinct().ToList();
		}

{'fraction_non_alphanumeric': 0.10860280658938377, 'fraction_numerical': 0.0009151921903599756, 'mean_word_length': 3.4917808219178084, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5078364', 'n_tokens_mistral': 1042, 'n_tokens_neox': 919, 'n_words': 336}