//
//  NSMutableAttributedString+DDCategory.h
//  DDCategoryKit_Private
//  Created by DDIsFriend on 2022/7/29.

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSMutableAttributedString (DDCategory)
/**
 *@param string this string will be a mutableAttributedString with attrs.
 *@param attrs @{NSAttributedStringKey : value}.
 */
- (NSMutableAttributedString *)dd_appendString:(NSString *)string attributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs;
/**
 *return a unmutableAttributedString.
 */
- (NSAttributedString *)dd_immutable;

/**
 *@param attributedString  attributedString
 */
- (NSMutableAttributedString *)dd_appendAttributedString:(NSAttributedString *)attributedString;

/**
 @param pattern RegularExpressionWithPattern.
 @param attrs pattern be matched will  be with attrs.
 */
- (NSMutableAttributedString *)dd_matchesRegularExpressionWithPattern:(NSString *)pattern withAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs;

/**
 @param pattern RegularExpressionWithPattern.
 @param attrs the first pattern be matched will  be with attrs.
 */
- (NSMutableAttributedString *)dd_firstMatchesRegularExpressionWithPattern:(NSString *)pattern withAttributes:(nullable NSDictionary<NSAttributedStringKey, id> *)attrs;

@end

NS_ASSUME_NONNULL_END
