Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
changsanjiang committed Apr 10, 2018
2 parents 961242a + d3d8f34 commit e555e5b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,17 @@ pod 'SJAttributesStringMaker'
```
___

### 关于v1版本

```ruby
// 抱歉各位, 由于结构调整, `v1``v2`版本差距较大, 大家可以如下方式, 继续使用`v1`版本的.
 pod 'SJAttributesFactory', '1.1.14'
```
___

### regular expression
<img src="https://github.com/changsanjiang/SJAttributesFactory/blob/master/Demo/SJAttributesFactory/regular.jpeg" />

```Objective-C
sj_makeAttributesString(^(SJAttributeWorker * _Nonnull make) {
make.insert(@"@迷你世界联机 :@江叔 用小淘气耍赖野人#迷你世界#", 0);

make.regexp(@"[@][^\\s]+\\s", ^(SJAttributesRangeOperator * _Nonnull matched) {
make.regexp(@"@\\w+", ^(SJAttributesRangeOperator * _Nonnull matched) {
matched.textColor([UIColor purpleColor]);
});
make.regexp(@"[#][^#]+#", ^(SJAttributesRangeOperator * _Nonnull matched) {
make.regexp(@"#[^#]+#", ^(SJAttributesRangeOperator * _Nonnull matched) {
matched.textColor([UIColor orangeColor]);
});
});
Expand Down

0 comments on commit e555e5b

Please sign in to comment.